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
This commit is contained in:
corentt
2022-11-08 21:23:41 +01:00
committed by GitHub
parent 615c57bf0b
commit 37997d4dda
2 changed files with 3 additions and 8 deletions

View File

@@ -168,13 +168,6 @@ namespace Content.Server.Atmos.EntitySystems
if (component.Air == null) if (component.Air == null)
return new GasMixture(volume); 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 molesNeeded = component.OutputPressure * volume / (Atmospherics.R * component.Air.Temperature);
var air = RemoveAir(component, molesNeeded); var air = RemoveAir(component, molesNeeded);

View File

@@ -113,7 +113,9 @@ public sealed class InternalsSystem : EntitySystem
{ {
if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2; if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2;
if (TryComp<GasTankComponent>(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<GasTankComponent>(component.GasTankEntity, out var gasTank)
&& (gasTank.OutputPressure * Atmospherics.BreathVolume / Atmospherics.R * gasTank.Air.Temperature) >= gasTank.Air.TotalMoles)
return 0; return 0;
return 1; return 1;