Fix pipe net null error (#9508)

This commit is contained in:
Leon Friedrich
2022-07-07 15:36:07 +12:00
committed by GitHub
parent 731e9cbd9f
commit d9c247b310
6 changed files with 32 additions and 28 deletions

View File

@@ -139,6 +139,8 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
private void OnCanisterUpdated(EntityUid uid, GasCanisterComponent canister, AtmosDeviceUpdateEvent args)
{
_atmosphereSystem.React(canister.Air, canister);
if (!EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
|| !EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
return;
@@ -146,8 +148,6 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (!nodeContainer.TryGetNode(canister.PortName, out PortablePipeNode? portNode))
return;
_atmosphereSystem.React(canister.Air, portNode);
if (portNode.NodeGroup is PipeNet {NodeCount: > 1} net)
{
var buffer = new GasMixture(net.Air.Volume + canister.Air.Volume);