fix: Show both port and internal gas when gas scanning a portable scrubber (#11495)
This commit is contained in:
@@ -165,14 +165,13 @@ namespace Content.Server.Atmos.Portable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void OnScrubberAnalyzed(EntityUid uid, PortableScrubberComponent component, GasAnalyzerScanEvent args)
|
private void OnScrubberAnalyzed(EntityUid uid, PortableScrubberComponent component, GasAnalyzerScanEvent args)
|
||||||
{
|
{
|
||||||
var gasMixDict = new Dictionary<string, GasMixture?>();
|
var gasMixDict = new Dictionary<string, GasMixture?> { { Name(uid), component.Air } };
|
||||||
// If it's connected to a port, include the port side
|
// 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(component.PortName, port.Air);
|
||||||
}
|
}
|
||||||
gasMixDict.Add(Name(uid), component.Air);
|
|
||||||
args.GasMixtures = gasMixDict;
|
args.GasMixtures = gasMixDict;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user