Gas tank internals alerts (#9567)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Robust.Shared.Collections;
|
||||
@@ -7,6 +8,8 @@ namespace Content.Server.Movement.Systems;
|
||||
|
||||
public sealed class JetpackSystem : SharedJetpackSystem
|
||||
{
|
||||
[Dependency] private readonly GasTankSystem _gasTank = default!;
|
||||
|
||||
private const float UpdateCooldown = 0.5f;
|
||||
|
||||
protected override bool CanEnable(JetpackComponent component)
|
||||
@@ -26,7 +29,7 @@ public sealed class JetpackSystem : SharedJetpackSystem
|
||||
if (active.Accumulator < UpdateCooldown) continue;
|
||||
|
||||
active.Accumulator -= UpdateCooldown;
|
||||
var air = gasTank.RemoveAir(comp.MoleUsage);
|
||||
var air = _gasTank.RemoveAir(gasTank, comp.MoleUsage);
|
||||
|
||||
if (air == null || !MathHelper.CloseTo(air.TotalMoles, comp.MoleUsage, 0.001f))
|
||||
{
|
||||
@@ -34,7 +37,7 @@ public sealed class JetpackSystem : SharedJetpackSystem
|
||||
continue;
|
||||
}
|
||||
|
||||
gasTank.UpdateUserInterface();
|
||||
_gasTank.UpdateUserInterface(gasTank);
|
||||
}
|
||||
|
||||
foreach (var comp in toDisable)
|
||||
|
||||
Reference in New Issue
Block a user