Internals alert fix and adjustment (#12517)

* add low pressure data field

* resolve CheckSeverity bug, replace logic

* add configurable low pressure threshhold
This commit is contained in:
Bright0
2022-11-09 19:02:14 -06:00
committed by GitHub
parent 8afc52878d
commit ecc969d8f4
3 changed files with 14 additions and 4 deletions

View File

@@ -208,10 +208,10 @@ public sealed class InternalsSystem : EntitySystem
{
if (component.BreathToolEntity == null || !AreInternalsWorking(component)) return 2;
// What we are checking here is if there is more moles in tank than we need.
// If pressure in the tank is below low pressure threshhold, flash warning on internals UI
if (TryComp<GasTankComponent>(component.GasTankEntity, out var gasTank)
&& (gasTank.OutputPressure * Atmospherics.BreathVolume / Atmospherics.R * gasTank.Air.Temperature) >= gasTank.Air.TotalMoles)
return 0;
&& gasTank.IsLowPressure)
return 0;
return 1;
}