From f160f538864dc5bcc69d5246c7612799b0ec8a07 Mon Sep 17 00:00:00 2001 From: Caspian Tyler <89215235+TreadTheDawnGames@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:25:35 -0500 Subject: [PATCH 1/7] Ping errors solved --- About/About.xml | 2 +- Source/Client/UI/DrawPingPlanet.cs | 9 ++++++++- Source/Client/UI/LocationPings.cs | 15 +++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/About/About.xml b/About/About.xml index 8e190b45..0ff4f278 100644 --- a/About/About.xml +++ b/About/About.xml @@ -1,6 +1,6 @@ - rwmt.Multiplayer + rwmt.Multiplayer.testing Multiplayer
  • 1.6
  • diff --git a/Source/Client/UI/DrawPingPlanet.cs b/Source/Client/UI/DrawPingPlanet.cs index f226cff7..dd6ab3e9 100644 --- a/Source/Client/UI/DrawPingPlanet.cs +++ b/Source/Client/UI/DrawPingPlanet.cs @@ -17,10 +17,17 @@ static void Postfix() if (ping.mapId != -1) continue; if (ping.PlayerInfo is not { } player) continue; + Log.Message("planetlayer: " + ping.planetTile.Layer.def.defName); + var tileCenter = GenWorldUI.WorldToUIPosition(Find.WorldGrid.GetTileCenter(ping.planetTile)); const float size = 30f; - ping.DrawAt(tileCenter, player.color, size); + //Only draw pings for layers that are on the layer we're at or lower + if (PlanetLayer.Selected.layerId >= ping.planetTile.layerId) + { + + ping.DrawAt(tileCenter, player.color, size); + } } } } diff --git a/Source/Client/UI/LocationPings.cs b/Source/Client/UI/LocationPings.cs index d1f942ac..0cda8210 100644 --- a/Source/Client/UI/LocationPings.cs +++ b/Source/Client/UI/LocationPings.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; using Multiplayer.Client.Util; using Multiplayer.Common; using RimWorld; @@ -23,9 +24,20 @@ public void UpdatePing() if (MultiplayerStatic.PingKeyDef.JustPressed || KeyDown(Multiplayer.settings.sendPingButton)) { if (WorldRendererUtility.WorldSelected) - PingLocation(-1, GenWorld.MouseTile(), Vector3.zero); + { + //Get the tile under the mouse and snap it to the nearest valid item (asteroid if in space, etc) + var mouseTile = GenWorld.MouseTile(true); + + //If the tileId == -1, mouseTile is invalid (eg. mouse is over ocean or in space) and out of range. + if (mouseTile.tileId != -1) + { + PingLocation(-1, mouseTile, Vector3.zero); + } + } else if (Find.CurrentMap != null) + { PingLocation(Find.CurrentMap.uniqueID, 0, UI.MouseMapPosition()); + } } for (int i = pings.Count - 1; i >= 0; i--) @@ -75,7 +87,6 @@ private void PingLocation(int map, PlanetTile tile, Vector3 loc) public void ReceivePing(int player, int map, PlanetTile tile, Vector3 loc) { if (!Multiplayer.settings.enablePings) return; - pings.RemoveAll(p => p.player == player); pings.Add(new PingInfo { player = player, mapId = map, planetTile = tile, mapLoc = loc }); alertHidden = false; From edec51e2fcb119009902aff98cef16981a4e83fa Mon Sep 17 00:00:00 2001 From: Caspian Tyler <89215235+TreadTheDawnGames@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:36:07 -0500 Subject: [PATCH 2/7] Remove '.testing' from about --- About/About.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/About/About.xml b/About/About.xml index 0ff4f278..8e190b45 100644 --- a/About/About.xml +++ b/About/About.xml @@ -1,6 +1,6 @@ - rwmt.Multiplayer.testing + rwmt.Multiplayer Multiplayer
  • 1.6
  • From 83728c56d4124dd99a0d56e62c419fb72ed2bb62 Mon Sep 17 00:00:00 2001 From: Caspian Tyler <89215235+TreadTheDawnGames@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:38:07 -0500 Subject: [PATCH 3/7] Remove unused 'using' --- Source/Client/UI/LocationPings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Client/UI/LocationPings.cs b/Source/Client/UI/LocationPings.cs index 0cda8210..ed8ad4fd 100644 --- a/Source/Client/UI/LocationPings.cs +++ b/Source/Client/UI/LocationPings.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using Multiplayer.Client.Util; using Multiplayer.Common; using RimWorld; From 51fc08d7bafbeddf844b90903557b068f0e6159a Mon Sep 17 00:00:00 2001 From: Caspian Tyler <89215235+TreadTheDawnGames@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:38:41 -0500 Subject: [PATCH 4/7] Remove debug logs --- Source/Client/UI/DrawPingPlanet.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/Client/UI/DrawPingPlanet.cs b/Source/Client/UI/DrawPingPlanet.cs index dd6ab3e9..1e570563 100644 --- a/Source/Client/UI/DrawPingPlanet.cs +++ b/Source/Client/UI/DrawPingPlanet.cs @@ -17,8 +17,6 @@ static void Postfix() if (ping.mapId != -1) continue; if (ping.PlayerInfo is not { } player) continue; - Log.Message("planetlayer: " + ping.planetTile.Layer.def.defName); - var tileCenter = GenWorldUI.WorldToUIPosition(Find.WorldGrid.GetTileCenter(ping.planetTile)); const float size = 30f; From 39c7fd560c735ba787116a613f5fa31371ae37df Mon Sep 17 00:00:00 2001 From: Caspian Tyler <89215235+TreadTheDawnGames@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:40:42 -0500 Subject: [PATCH 5/7] Formatting --- Source/Client/UI/DrawPingPlanet.cs | 3 --- Source/Client/UI/LocationPings.cs | 10 +++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Source/Client/UI/DrawPingPlanet.cs b/Source/Client/UI/DrawPingPlanet.cs index 1e570563..103f0681 100644 --- a/Source/Client/UI/DrawPingPlanet.cs +++ b/Source/Client/UI/DrawPingPlanet.cs @@ -22,10 +22,7 @@ static void Postfix() //Only draw pings for layers that are on the layer we're at or lower if (PlanetLayer.Selected.layerId >= ping.planetTile.layerId) - { - ping.DrawAt(tileCenter, player.color, size); - } } } } diff --git a/Source/Client/UI/LocationPings.cs b/Source/Client/UI/LocationPings.cs index ed8ad4fd..fa3bb1a4 100644 --- a/Source/Client/UI/LocationPings.cs +++ b/Source/Client/UI/LocationPings.cs @@ -24,19 +24,15 @@ public void UpdatePing() { if (WorldRendererUtility.WorldSelected) { - //Get the tile under the mouse and snap it to the nearest valid item (asteroid if in space, etc) + //Get the tile under the mouse and snap it to the nearest valid item. (i.e. An asteroid if in space, etc) var mouseTile = GenWorld.MouseTile(true); - //If the tileId == -1, mouseTile is invalid (eg. mouse is over ocean or in space) and out of range. + //If the tileId == -1, mouseTile is invalid (i.e. the mouse is over ocean or in space) and out of range. if (mouseTile.tileId != -1) - { PingLocation(-1, mouseTile, Vector3.zero); - } } else if (Find.CurrentMap != null) - { PingLocation(Find.CurrentMap.uniqueID, 0, UI.MouseMapPosition()); - } } for (int i = pings.Count - 1; i >= 0; i--) @@ -93,4 +89,4 @@ public void ReceivePing(int player, int map, PlanetTile tile, Vector3 loc) if (player != Multiplayer.session.playerId) SoundDefOf.TinyBell.PlayOneShotOnCamera(); } -} +} From 68c8802a772a1203a832e2a5b0d8c64b1a777853 Mon Sep 17 00:00:00 2001 From: Caspian Tyler <89215235+TreadTheDawnGames@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:41:19 -0500 Subject: [PATCH 6/7] Remove spaces at file ending. --- Source/Client/UI/LocationPings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Client/UI/LocationPings.cs b/Source/Client/UI/LocationPings.cs index fa3bb1a4..5acff430 100644 --- a/Source/Client/UI/LocationPings.cs +++ b/Source/Client/UI/LocationPings.cs @@ -89,4 +89,4 @@ public void ReceivePing(int player, int map, PlanetTile tile, Vector3 loc) if (player != Multiplayer.session.playerId) SoundDefOf.TinyBell.PlayOneShotOnCamera(); } -} +} From 9f7e9b3de586db48037977f6f1e5514a8c4c2824 Mon Sep 17 00:00:00 2001 From: Caspian Tyler <89215235+TreadTheDawnGames@users.noreply.github.com> Date: Sun, 16 Nov 2025 21:42:15 -0500 Subject: [PATCH 7/7] Formatting --- Source/Client/UI/LocationPings.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Client/UI/LocationPings.cs b/Source/Client/UI/LocationPings.cs index 5acff430..4d527e61 100644 --- a/Source/Client/UI/LocationPings.cs +++ b/Source/Client/UI/LocationPings.cs @@ -82,6 +82,7 @@ private void PingLocation(int map, PlanetTile tile, Vector3 loc) public void ReceivePing(int player, int map, PlanetTile tile, Vector3 loc) { if (!Multiplayer.settings.enablePings) return; + pings.RemoveAll(p => p.player == player); pings.Add(new PingInfo { player = player, mapId = map, planetTile = tile, mapLoc = loc }); alertHidden = false;