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

@@ -114,18 +114,18 @@ namespace Content.Server.StationEvents.Events
if (_timeUntilLeak > 0f) return;
_timeUntilLeak += LeakCooldown;
var atmosphereSystem = EntitySystem.Get<AtmosphereSystem>();
var atmosphereSystem = _entityManager.EntitySysManager.GetEntitySystem<AtmosphereSystem>();
if (!_foundTile ||
_targetGrid == default ||
_entityManager.Deleted(_targetGrid) ||
!atmosphereSystem.IsSimulatedGrid(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridEntityId))
!atmosphereSystem.IsSimulatedGrid(_targetGrid))
{
Running = false;
return;
}
var environment = atmosphereSystem.GetTileMixture(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridEntityId, _targetTile, true);
var environment = atmosphereSystem.GetTileMixture(_targetGrid, _targetTile, true);
environment?.AdjustMoles(_leakGas, LeakCooldown * _molesPerSecond);
}
@@ -152,14 +152,14 @@ namespace Content.Server.StationEvents.Events
if (!_foundTile ||
_targetGrid == default ||
(!_entityManager.EntityExists(_targetGrid) ? EntityLifeStage.Deleted : _entityManager.GetComponent<MetaDataComponent>(_targetGrid).EntityLifeStage) >= EntityLifeStage.Deleted ||
!atmosphereSystem.IsSimulatedGrid(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridEntityId))
!atmosphereSystem.IsSimulatedGrid(_targetGrid))
{
return;
}
// Don't want it to be so obnoxious as to instantly murder anyone in the area but enough that
// it COULD start potentially start a bigger fire.
atmosphereSystem.HotspotExpose(_entityManager.GetComponent<TransformComponent>(_targetGrid).GridID, _targetTile, 700f, 50f, true);
atmosphereSystem.HotspotExpose(_targetGrid, _targetTile, 700f, 50f, true);
SoundSystem.Play("/Audio/Effects/sparks4.ogg", Filter.Pvs(_targetCoords), _targetCoords);
}
}