Add sprite for vent under-pressure lock-out (#29527)
This commit is contained in:
@@ -83,13 +83,18 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
var timeDelta = args.dt;
|
||||
var pressureDelta = timeDelta * vent.TargetPressureChange;
|
||||
|
||||
var lockout = (environment.Pressure < vent.UnderPressureLockoutThreshold);
|
||||
if (vent.UnderPressureLockout != lockout) // update visuals only if this changes
|
||||
{
|
||||
vent.UnderPressureLockout = lockout;
|
||||
UpdateState(uid, vent);
|
||||
}
|
||||
|
||||
if (vent.PumpDirection == VentPumpDirection.Releasing && pipe.Air.Pressure > 0)
|
||||
{
|
||||
if (environment.Pressure > vent.MaxPressure)
|
||||
return;
|
||||
|
||||
vent.UnderPressureLockout = (environment.Pressure < vent.UnderPressureLockoutThreshold);
|
||||
|
||||
if ((vent.PressureChecks & VentPressureBound.ExternalBound) != 0)
|
||||
{
|
||||
// Vents cannot supply high pressures from an almost empty pipe, instead it's proportional to the pipe
|
||||
@@ -267,7 +272,10 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
}
|
||||
else if (vent.PumpDirection == VentPumpDirection.Releasing)
|
||||
{
|
||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance);
|
||||
if (vent.UnderPressureLockout & !vent.PressureLockoutOverride)
|
||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Lockout, appearance);
|
||||
else
|
||||
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Out, appearance);
|
||||
}
|
||||
else if (vent.PumpDirection == VentPumpDirection.Siphoning)
|
||||
{
|
||||
@@ -281,7 +289,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
|
||||
return;
|
||||
if (args.IsInDetailsRange)
|
||||
{
|
||||
if (pumpComponent.UnderPressureLockout & !pumpComponent.PressureLockoutOverride)
|
||||
if (pumpComponent.PumpDirection == VentPumpDirection.Releasing & pumpComponent.UnderPressureLockout & !pumpComponent.PressureLockoutOverride)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("gas-vent-pump-uvlo"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user