Fix a null reference exception (InteractionSystem) that crashed the hell out of the client.

This commit is contained in:
FL-OZ
2020-05-10 01:47:26 -05:00
parent 6ff691c338
commit 28c50261ac

View File

@@ -51,7 +51,9 @@ namespace Content.Server.GameObjects.EntitySystems
var rayResults = _physicsManager.IntersectRayWithPredicate(coords.MapId, ray, dir.Length, predicate, true);
if(!rayResults.DidHitObject || (insideBlockerValid && rayResults.DidHitObject && (rayResults.HitPos - otherCoords).Length < 1f))
{
_mapManager.TryFindGridAt(coords, out var mapGrid);
if (_mapManager.TryFindGridAt(coords, out var mapGrid) && mapGrid != null)
{
var srcPos = mapGrid.MapToGrid(coords);
var destPos = new GridCoordinates(otherCoords, mapGrid);
if (srcPos.InRange(_mapManager, destPos, range))
@@ -59,6 +61,8 @@ namespace Content.Server.GameObjects.EntitySystems
return true;
}
}
}
return false;
}