From 37997d4dda83d1e98e460e889d680ea0acbcc017 Mon Sep 17 00:00:00 2001 From: corentt <36075110+corentt@users.noreply.github.com> Date: Tue, 8 Nov 2022 21:23:41 +0100 Subject: [PATCH] Stop reducing output pressure of gastank when low pressure (#11818) * stop reducing output of gastank when low pressure * fix display internal alert * rephrase moles quantity check --- Content.Server/Atmos/EntitySystems/GasTankSystem.cs | 7 ------- Content.Server/Body/Systems/InternalsSystem.cs | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Content.Server/Atmos/EntitySystems/GasTankSystem.cs b/Content.Server/Atmos/EntitySystems/GasTankSystem.cs index 56b1003c4e..27dfeea451 100644 --- a/Content.Server/Atmos/EntitySystems/GasTankSystem.cs +++ b/Content.Server/Atmos/EntitySystems/GasTankSystem.cs @@ -168,13 +168,6 @@ namespace Content.Server.Atmos.EntitySystems if (component.Air == null) return new GasMixture(volume); - var tankPressure = component.Air.Pressure; - if (tankPressure < component.OutputPressure) - { - component.OutputPressure = tankPressure; - UpdateUserInterface(component); - } - var molesNeeded = component.OutputPressure * volume / (Atmospherics.R * component.Air.Temperature); var air = RemoveAir(component, molesNeeded); diff --git a/Content.Server/Body/Systems/InternalsSystem.cs b/Content.Server/Body/Systems/InternalsSystem.cs index ecb8d1363a..d7cce25c7b 100644 --- a/Content.Server/Body/Systems/InternalsSystem.cs +++ b/Content.Server/Body/Systems/InternalsSystem.cs @@ -113,7 +113,9 @@ public sealed class InternalsSystem : EntitySystem { if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2; - if (TryComp(component.GasTankEntity, out var gasTank) && gasTank.Air.Volume < Atmospherics.BreathVolume) + // What we are checking here is if there is more moles in tank than we need. + if (TryComp(component.GasTankEntity, out var gasTank) + && (gasTank.OutputPressure * Atmospherics.BreathVolume / Atmospherics.R * gasTank.Air.Temperature) >= gasTank.Air.TotalMoles) return 0; return 1;