Remove atmos device dependency on game timer (#18847)
This commit is contained in:
@@ -8,14 +8,12 @@ using Content.Shared.Atmos.Piping;
|
||||
using Content.Shared.Audio;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class PressureControlledValveSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
@@ -70,7 +68,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
UpdateAppearance(uid, comp);
|
||||
|
||||
// We multiply the transfer rate in L/s by the seconds passed since the last process to get the liters.
|
||||
var transferVolume = (float)(transferRate * (_gameTiming.CurTime - device.LastProcess).TotalSeconds);
|
||||
var transferVolume = (float)(transferRate * args.dt);
|
||||
if (transferVolume <= 0)
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(comp.Owner, false);
|
||||
|
||||
Reference in New Issue
Block a user