Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Source/Client/UI/DrawPingPlanet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion Source/Client/UI/LocationPings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down