Atmos device performance improvements (#26493)

* Atmos device performance improvements

* AtmosDirection perf improvements

* Fix errors

* Add GasTileOverlayComponent arguments

* Make excite no longer invalidate a tile
This commit is contained in:
Leon Friedrich
2024-03-30 17:17:53 +13:00
committed by GitHub
parent aa96baeb5f
commit 888a3bda51
51 changed files with 373 additions and 324 deletions

View File

@@ -40,24 +40,16 @@ public sealed class HeatExchangerSystem : EntitySystem
private void OnAtmosUpdate(EntityUid uid, HeatExchangerComponent comp, ref AtmosDeviceUpdateEvent args)
{
if (!TryComp(uid, out NodeContainerComponent? nodeContainer)
|| !TryComp(uid, out AtmosDeviceComponent? device)
|| !_nodeContainer.TryGetNode(nodeContainer, comp.InletName, out PipeNode? inlet)
|| !_nodeContainer.TryGetNode(nodeContainer, comp.OutletName, out PipeNode? outlet))
// make sure that the tile the device is on isn't blocked by a wall or something similar.
if (args.Grid is {} grid
&& _transform.TryGetGridTilePosition(uid, out var tile)
&& _atmosphereSystem.IsTileAirBlocked(grid, tile))
{
return;
}
// make sure that the tile the device is on isn't blocked by a wall or something similar.
var xform = Transform(uid);
if (_transform.TryGetGridTilePosition(uid, out var tile))
{
// TryGetGridTilePosition() already returns false if GridUid is null, but the null checker isn't smart enough yet
if (xform.GridUid != null && _atmosphereSystem.IsTileAirBlocked(xform.GridUid.Value, tile))
{
return;
}
}
if (!_nodeContainer.TryGetNodes(uid, comp.InletName, comp.OutletName, out PipeNode? inlet, out PipeNode? outlet))
return;
var dt = args.dt;