Fixes jetpacks not shutting off on lack of fuel (#9206)
* Push * tolerance and reduced moles Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,10 +1,7 @@
|
|||||||
using Content.Server.Atmos.Components;
|
using Content.Server.Atmos.Components;
|
||||||
using Content.Server.Atmos.EntitySystems;
|
|
||||||
using Content.Server.Movement.Components;
|
|
||||||
using Content.Shared.Movement.Components;
|
using Content.Shared.Movement.Components;
|
||||||
using Content.Shared.Movement.Systems;
|
using Content.Shared.Movement.Systems;
|
||||||
using Robust.Shared.Collections;
|
using Robust.Shared.Collections;
|
||||||
using Robust.Shared.GameStates;
|
|
||||||
|
|
||||||
namespace Content.Server.Movement.Systems;
|
namespace Content.Server.Movement.Systems;
|
||||||
|
|
||||||
@@ -31,7 +28,7 @@ public sealed class JetpackSystem : SharedJetpackSystem
|
|||||||
active.Accumulator -= UpdateCooldown;
|
active.Accumulator -= UpdateCooldown;
|
||||||
var air = gasTank.RemoveAir(comp.MoleUsage);
|
var air = gasTank.RemoveAir(comp.MoleUsage);
|
||||||
|
|
||||||
if (air == null || !MathHelper.CloseTo(air.TotalMoles, comp.MoleUsage, 0.1f))
|
if (air == null || !MathHelper.CloseTo(air.TotalMoles, comp.MoleUsage, 0.001f))
|
||||||
{
|
{
|
||||||
toDisable.Add(comp);
|
toDisable.Add(comp);
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Content.Shared.Movement.Components;
|
|||||||
public sealed class JetpackComponent : Component
|
public sealed class JetpackComponent : Component
|
||||||
{
|
{
|
||||||
[ViewVariables(VVAccess.ReadWrite), DataField("moleUsage")]
|
[ViewVariables(VVAccess.ReadWrite), DataField("moleUsage")]
|
||||||
public float MoleUsage = 0.048f;
|
public float MoleUsage = 0.012f;
|
||||||
|
|
||||||
[ViewVariables, DataField("toggleAction", required: true)]
|
[ViewVariables, DataField("toggleAction", required: true)]
|
||||||
public InstantAction ToggleAction = new();
|
public InstantAction ToggleAction = new();
|
||||||
|
|||||||
Reference in New Issue
Block a user