Fix decal placer crashing when placing/removing in space

This commit is contained in:
Kara D 2022-02-08 15:29:23 -07:00
parent a3061fd855
commit 49007d68e7
No known key found for this signature in database
GPG Key ID: 42F001DDA3E95C84
1 changed files with 6 additions and 0 deletions

View File

@ -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;