Remove atmos device dependency on game timer (#18847)

This commit is contained in:
Kevin Zheng
2023-08-12 23:42:12 -07:00
committed by GitHub
parent 551de79efa
commit d7fa5b73c3
9 changed files with 9 additions and 34 deletions

View File

@@ -8,7 +8,6 @@ using Content.Shared.Atmos.Piping;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Timing;
namespace Content.Server.Atmos.Piping.Unary.EntitySystems
{
@@ -16,7 +15,6 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
public sealed class GasOutletInjectorSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
@@ -73,7 +71,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (environment.Pressure > injector.MaxPressure)
return;
var timeDelta = (float) (_gameTiming.CurTime - device.LastProcess).TotalSeconds;
var timeDelta = args.dt;
// TODO adjust ratio so that environment does not go above MaxPressure?
var ratio = MathF.Min(1f, timeDelta * injector.TransferRate / inlet.Air.Volume);