Fix decal placer crashing when placing/removing in space
This commit is contained in:
@@ -109,6 +109,9 @@ namespace Content.Server.Decals
|
|||||||
|
|
||||||
var gridId = ev.Coordinates.GetGridId(EntityManager);
|
var gridId = ev.Coordinates.GetGridId(EntityManager);
|
||||||
|
|
||||||
|
if (!gridId.IsValid())
|
||||||
|
return;
|
||||||
|
|
||||||
// remove all decals on the same tile
|
// remove all decals on the same tile
|
||||||
foreach (var decal in GetDecalsInRange(gridId, ev.Coordinates.Position))
|
foreach (var decal in GetDecalsInRange(gridId, ev.Coordinates.Position))
|
||||||
{
|
{
|
||||||
@@ -141,6 +144,9 @@ namespace Content.Server.Decals
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var gridId = coordinates.GetGridId(EntityManager);
|
var gridId = coordinates.GetGridId(EntityManager);
|
||||||
|
if (!gridId.IsValid())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (MapManager.GetGrid(gridId).GetTileRef(coordinates).IsSpace())
|
if (MapManager.GetGrid(gridId).GetTileRef(coordinates).IsSpace())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user