From 5c4f32454fab3670f15f569652a7f80b5bae2e8c Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 8 Dec 2022 12:47:31 +1100 Subject: [PATCH] Fix landing sounds on planetmaps (#12888) --- Content.Server/Sound/EmitSoundSystem.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Server/Sound/EmitSoundSystem.cs b/Content.Server/Sound/EmitSoundSystem.cs index 64a5c34535..23e512a03b 100644 --- a/Content.Server/Sound/EmitSoundSystem.cs +++ b/Content.Server/Sound/EmitSoundSystem.cs @@ -79,14 +79,16 @@ namespace Content.Server.Sound args.Handled = true; } - private void HandleEmitSoundOnLand(EntityUid eUI, BaseEmitSoundComponent component, LandEvent arg) + private void HandleEmitSoundOnLand(EntityUid uid, BaseEmitSoundComponent component, LandEvent arg) { - if (!TryComp(eUI, out var xform) || + if (!TryComp(uid, out var xform) || !_mapManager.TryGetGrid(xform.GridUid, out var grid)) return; var tile = grid.GetTileRef(xform.Coordinates); - if (tile.IsSpace(_tileDefMan)) return; + // Handle maps being grids (we'll still emit the sound). + if (xform.GridUid != xform.MapUid && tile.IsSpace(_tileDefMan)) + return; TryEmitSound(component); }