From 49007d68e7916f8a496abbe371fcc91d4c4c926a Mon Sep 17 00:00:00 2001 From: Kara D Date: Tue, 8 Feb 2022 15:29:23 -0700 Subject: [PATCH] Fix decal placer crashing when placing/removing in space --- Content.Server/Decals/DecalSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/Decals/DecalSystem.cs b/Content.Server/Decals/DecalSystem.cs index 91a998cf3c..2b8b1efc1e 100644 --- a/Content.Server/Decals/DecalSystem.cs +++ b/Content.Server/Decals/DecalSystem.cs @@ -109,6 +109,9 @@ namespace Content.Server.Decals var gridId = ev.Coordinates.GetGridId(EntityManager); + if (!gridId.IsValid()) + return; + // remove all decals on the same tile foreach (var decal in GetDecalsInRange(gridId, ev.Coordinates.Position)) { @@ -141,6 +144,9 @@ namespace Content.Server.Decals return false; var gridId = coordinates.GetGridId(EntityManager); + if (!gridId.IsValid()) + return false; + if (MapManager.GetGrid(gridId).GetTileRef(coordinates).IsSpace()) return false;