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

@@ -125,7 +125,7 @@ namespace Content.Server.Atmos.EntitySystems
/// </summary>
/// <param name="grid">Grid to be checked.</param>
/// <returns>Whether the grid has a simulated atmosphere.</returns>
public bool IsSimulatedGrid(EntityUid grid)
public bool IsSimulatedGrid(EntityUid? grid)
{
if (!_mapManager.TryGetGrid(grid, out var mapGrid))
return false;
@@ -1376,7 +1376,7 @@ namespace Content.Server.Atmos.EntitySystems
public bool AddAtmosDevice(AtmosDeviceComponent atmosDevice)
{
var grid = Comp<TransformComponent>(atmosDevice.Owner).GridEntityId;
var grid = Comp<TransformComponent>(atmosDevice.Owner).GridUid;
if (!_mapManager.TryGetGrid(grid, out var mapGrid))
return false;
@@ -1578,7 +1578,7 @@ namespace Content.Server.Atmos.EntitySystems
return false;
}
var gridId = coordinates.GetGridEntityId(EntityManager);
var gridId = coordinates.GetGridUid(EntityManager);
if (!_mapManager.TryGetGrid(gridId, out var grid))
{
@@ -1586,7 +1586,7 @@ namespace Content.Server.Atmos.EntitySystems
return false;
}
tuple = (gridId, grid.TileIndicesFor(coordinates));
tuple = (gridId.Value, grid.TileIndicesFor(coordinates));
return true;
}