Gas tank internals alerts (#9567)

This commit is contained in:
metalgearsloth
2022-07-25 14:42:25 +10:00
committed by GitHub
parent dad26db137
commit 40a7584c2f
25 changed files with 570 additions and 354 deletions

View File

@@ -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)