Nullable grid Uid (#8798)
This commit is contained in:
@@ -477,9 +477,12 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
return false;
|
||||
}
|
||||
|
||||
var grid = _mapManager.GetGrid(EntityManager.GetComponent<TransformComponent>(component.Owner).GridEntityId);
|
||||
var coords = EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates;
|
||||
var entry = grid.GetLocal(coords)
|
||||
var xform = Transform(component.Owner);
|
||||
if (!TryComp(xform.GridUid, out IMapGridComponent? grid))
|
||||
return false;
|
||||
|
||||
var coords = xform.Coordinates;
|
||||
var entry = grid.Grid.GetLocal(coords)
|
||||
.FirstOrDefault(entity => EntityManager.HasComponent<DisposalEntryComponent>(entity));
|
||||
|
||||
if (entry == default)
|
||||
@@ -490,7 +493,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
var air = component.Air;
|
||||
var entryComponent = EntityManager.GetComponent<DisposalEntryComponent>(entry);
|
||||
|
||||
if (_atmosSystem.GetTileMixture(EntityManager.GetComponent<TransformComponent>(component.Owner).Coordinates, true) is {Temperature: > 0} environment)
|
||||
if (_atmosSystem.GetTileMixture(xform.Coordinates, true) is {Temperature: > 0} environment)
|
||||
{
|
||||
var transferMoles = 0.1f * (0.25f * Atmospherics.OneAtmosphere * 1.01f - air.Pressure) * air.Volume / (environment.Temperature * Atmospherics.R);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user