Nullable grid Uid (#8798)
This commit is contained in:
@@ -30,7 +30,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
return;
|
||||
|
||||
// If we can't find any ports, cancel the anchoring.
|
||||
if(!FindGasPortIn(transform.GridEntityId, transform.Coordinates, out _))
|
||||
if(!FindGasPortIn(transform.GridUid, transform.Coordinates, out _))
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
@@ -50,15 +50,13 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
private bool FindGasPortIn(EntityUid gridId, EntityCoordinates coordinates, [NotNullWhen(true)] out GasPortComponent? port)
|
||||
private bool FindGasPortIn(EntityUid? gridId, EntityCoordinates coordinates, [NotNullWhen(true)] out GasPortComponent? port)
|
||||
{
|
||||
port = null;
|
||||
|
||||
if (!gridId.IsValid())
|
||||
if (!_mapManager.TryGetGrid(gridId, out var grid))
|
||||
return false;
|
||||
|
||||
var grid = _mapManager.GetGrid(gridId);
|
||||
|
||||
foreach (var entityUid in grid.GetLocal(coordinates))
|
||||
{
|
||||
if (EntityManager.TryGetComponent<GasPortComponent>(entityUid, out port))
|
||||
|
||||
Reference in New Issue
Block a user