From 3fcc87687aae686f3b32c1f7e67cbf97956be5ef Mon Sep 17 00:00:00 2001 From: Francesco Date: Sat, 24 Sep 2022 19:46:27 +0200 Subject: [PATCH] fix: Show both port and internal gas when gas scanning a portable scrubber (#11495) --- Content.Server/Atmos/Portable/PortableScrubberSystem.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Content.Server/Atmos/Portable/PortableScrubberSystem.cs b/Content.Server/Atmos/Portable/PortableScrubberSystem.cs index d122d29922..ceef3992e4 100644 --- a/Content.Server/Atmos/Portable/PortableScrubberSystem.cs +++ b/Content.Server/Atmos/Portable/PortableScrubberSystem.cs @@ -165,14 +165,13 @@ namespace Content.Server.Atmos.Portable /// private void OnScrubberAnalyzed(EntityUid uid, PortableScrubberComponent component, GasAnalyzerScanEvent args) { - var gasMixDict = new Dictionary(); + var gasMixDict = new Dictionary { { Name(uid), component.Air } }; // If it's connected to a port, include the port side - if (!EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)) + if (TryComp(uid, out NodeContainerComponent? nodeContainer)) { - if(nodeContainer != null && nodeContainer.TryGetNode(component.PortName, out PipeNode? port)) + if(nodeContainer.TryGetNode(component.PortName, out PipeNode? port)) gasMixDict.Add(component.PortName, port.Air); } - gasMixDict.Add(Name(uid), component.Air); args.GasMixtures = gasMixDict; } }