Skip to content

Commit

Permalink
Update PressureControlledValveSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Nov 1, 2024
1 parent 009c2c0 commit 337a16b
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,22 @@ private void OnUpdate(EntityUid uid, PressureControlledValveComponent comp, ref
}

// If the pressure in either inlet or outlet exceeds the side pressure, act as an open pipe.
if (controlNode.Air.Pressure > inletNode.Air.Pressure
|| controlNode.Air.Pressure > outletNode.Air.Pressure)
if (controlNode.Air.Pressure < inletNode.Air.Pressure
|| controlNode.Air.Pressure < outletNode.Air.Pressure)
{
inletNode.RemoveAlwaysReachable(outletNode);
outletNode.RemoveAlwaysReachable(inletNode);
comp.Enabled = false;
inletNode.AddAlwaysReachable(outletNode);
outletNode.AddAlwaysReachable(inletNode);
comp.Enabled = true;
UpdateAppearance(uid, comp);
_ambientSoundSystem.SetAmbience(uid, false);
_ambientSoundSystem.SetAmbience(uid, true);
return;
}

inletNode.AddAlwaysReachable(outletNode);
outletNode.AddAlwaysReachable(inletNode);

comp.Enabled = true;
inletNode.RemoveAlwaysReachable(outletNode);
outletNode.RemoveAlwaysReachable(inletNode);
comp.Enabled = false;
UpdateAppearance(uid, comp);
_ambientSoundSystem.SetAmbience(uid, true);
_ambientSoundSystem.SetAmbience(uid, false);
}

private void OnFilterLeaveAtmosphere(EntityUid uid, PressureControlledValveComponent comp, ref AtmosDeviceDisabledEvent args)
Expand Down

0 comments on commit 337a16b

Please sign in to comment.