Nullable grid Uid (#8798)

This commit is contained in:
Leon Friedrich
2022-06-20 12:14:35 +12:00
committed by GitHub
parent ef41cd5aa8
commit fa4c6f63f8
82 changed files with 318 additions and 242 deletions

View File

@@ -47,9 +47,13 @@ namespace Content.Server.Interaction
}
var mapManager = IoCManager.Resolve<IMapManager>();
var playerGrid = _entities.GetComponent<TransformComponent>(attached).GridEntityId;
var mapGrid = mapManager.GetGrid(playerGrid);
var playerPosition = _entities.GetComponent<TransformComponent>(attached).Coordinates;
var xform = _entities.GetComponent<TransformComponent>(attached);
var playerGrid = xform.GridUid;
if (!mapManager.TryGetGrid(playerGrid, out var mapGrid))
return;
var playerPosition = xform.Coordinates;
var tileDefinitionManager = IoCManager.Resolve<ITileDefinitionManager>();
for (var i = -radius; i <= radius; i++)