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
}
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)
{
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"));
}
"name":"vent_in",
"directions" : 4,
"delays":[ [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ], [ 0.08, 0.08, 0.08, 0.08 ] ]
+ },
+ {
+ "name":"vent_lockout",
+ "directions" : 4
}
]
}