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

@@ -48,7 +48,7 @@ namespace Content.Server.Power.EntitySystems
var xform = Transform(uid);
// If grid deleting no need to update power.
if (_mapManager.TryGetGrid(xform.GridEntityId, out var grid))
if (_mapManager.TryGetGrid(xform.GridUid, out var grid))
{
if (MetaData(grid.GridEntityId).EntityLifeStage > EntityLifeStage.MapInitialized) return;
}
@@ -120,7 +120,7 @@ namespace Content.Server.Power.EntitySystems
var xform = Transform(owner);
var coordinates = xform.Coordinates;
if (!_mapManager.TryGetGrid(xform.GridEntityId, out var grid))
if (!_mapManager.TryGetGrid(xform.GridUid, out var grid))
yield break;
var nearbyEntities = grid.GetCellsInSquareArea(coordinates, (int) Math.Ceiling(range / grid.TileSize));
@@ -238,7 +238,7 @@ namespace Content.Server.Power.EntitySystems
private bool TryFindAvailableProvider(EntityUid owner, float range, [NotNullWhen(true)] out ExtensionCableProviderComponent? foundProvider, TransformComponent? xform = null)
{
if (!Resolve(owner, ref xform) || !_mapManager.TryGetGrid(xform.GridEntityId, out var grid))
if (!Resolve(owner, ref xform) || !_mapManager.TryGetGrid(xform.GridUid, out var grid))
{
foundProvider = null;
return false;