Fix exception in IconSmoothSystem where it tries to get a grid that doesn't exist (#4064)

This finally ought to actually kill the bug for real this time. Hopefully.
This commit is contained in:
20kdc
2021-05-24 15:39:57 +01:00
committed by GitHub
parent e2cc5cd343
commit 136928ecb8

View File

@@ -66,10 +66,10 @@ namespace Content.Client.GameObjects.EntitySystems
// This is simpler to implement. If you want to optimize it be my guest.
var senderEnt = ev.Sender;
if (senderEnt.IsValid() &&
_mapManager.TryGetGrid(senderEnt.Transform.GridID, out var grid1) &&
senderEnt.TryGetComponent(out IconSmoothComponent? iconSmooth)
&& iconSmooth.Running)
{
var grid1 = _mapManager.GetGrid(senderEnt.Transform.GridID);
var coords = senderEnt.Transform.Coordinates;
_dirtyEntities.Enqueue(senderEnt.Uid);