diff --git a/Source/Client/UI/DrawPingPlanet.cs b/Source/Client/UI/DrawPingPlanet.cs index f226cff7..103f0681 100644 --- a/Source/Client/UI/DrawPingPlanet.cs +++ b/Source/Client/UI/DrawPingPlanet.cs @@ -20,7 +20,9 @@ static void Postfix() 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..4d527e61 100644 --- a/Source/Client/UI/LocationPings.cs +++ b/Source/Client/UI/LocationPings.cs @@ -23,7 +23,14 @@ 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. (i.e. An asteroid if in space, etc) + var mouseTile = GenWorld.MouseTile(true); + + //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()); }