]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Convert atmos device events to ref events (#22843)
authorKara <lunarautomaton6@gmail.com>
Fri, 22 Dec 2023 01:48:18 +0000 (18:48 -0700)
committerGitHub <noreply@github.com>
Fri, 22 Dec 2023 01:48:18 +0000 (17:48 -0800)
25 files changed:
Content.Server/Atmos/EntitySystems/AirFilterSystem.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs
Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs
Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs
Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasRecyclerSystem.cs
Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs
Content.Server/Atmos/Piping/Components/AtmosDeviceComponent.cs
Content.Server/Atmos/Piping/EntitySystems/AtmosDeviceSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs
Content.Server/Atmos/Piping/Trinary/EntitySystems/PressureControlledValveSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasCondenserSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasOutletInjectorSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasPassiveVentSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs
Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs
Content.Server/Atmos/Portable/PortableScrubberSystem.cs
Content.Server/Medical/CryoPodSystem.cs
Content.Server/Power/Generation/Teg/TegSystem.cs
Content.Server/Power/Generator/GasPowerReceiverSystem.cs

index 6230a184d7d502d7a0380ccc2fb7278e2e20708c..416045fc5ed9fc395bf00168ad491b2f1c78236b 100644 (file)
@@ -25,7 +25,7 @@ public sealed class AirFilterSystem : EntitySystem
         SubscribeLocalEvent<AirFilterComponent, AtmosDeviceUpdateEvent>(OnFilterUpdate);
     }
 
-    private void OnIntakeUpdate(EntityUid uid, AirIntakeComponent intake, AtmosDeviceUpdateEvent args)
+    private void OnIntakeUpdate(EntityUid uid, AirIntakeComponent intake, ref AtmosDeviceUpdateEvent args)
     {
         if (!GetAir(uid, out var air))
             return;
@@ -51,7 +51,7 @@ public sealed class AirFilterSystem : EntitySystem
         _atmosphere.Merge(air, environment.Remove(transferMoles));
     }
 
-    private void OnFilterUpdate(EntityUid uid, AirFilterComponent filter, AtmosDeviceUpdateEvent args)
+    private void OnFilterUpdate(EntityUid uid, AirFilterComponent filter, ref AtmosDeviceUpdateEvent args)
     {
         if (!GetAir(uid, out var air))
             return;
index ad0d409a4b3045bd8a60df564eb2074087ef8995..4f8df0af67074a4adfd13e793c03deb32e7fce40 100644 (file)
@@ -406,9 +406,10 @@ namespace Content.Server.Atmos.EntitySystems
 
             var time = _gameTiming.CurTime;
             var number = 0;
+            var ev = new AtmosDeviceUpdateEvent(RealAtmosTime());
             while (atmosphere.CurrentRunAtmosDevices.TryDequeue(out var device))
             {
-                RaiseLocalEvent(device, new AtmosDeviceUpdateEvent(RealAtmosTime()));
+                RaiseLocalEvent(device, ref ev);
                 device.Comp.LastProcess = time;
 
                 if (number++ < LagCheckIterations)
index 2541d98a7efbae97adf605431791bcb97a2fdafa..a71174d4d36f9fc98bc6efbc24e533e1551068f5 100644 (file)
@@ -43,7 +43,7 @@ public sealed class HeatExchangerSystem : EntitySystem
         tileLoss = val;
     }
 
-    private void OnAtmosUpdate(EntityUid uid, HeatExchangerComponent comp, AtmosDeviceUpdateEvent args)
+    private void OnAtmosUpdate(EntityUid uid, HeatExchangerComponent comp, ref AtmosDeviceUpdateEvent args)
     {
         if (!TryComp(uid, out NodeContainerComponent? nodeContainer)
                 || !TryComp(uid, out AtmosDeviceComponent? device)
index 190ac9d5c988e7ba1fc58ac80a5581a941ac24c9..b65d8556809eb2f2a41e56a32bad9c23a662c52f 100644 (file)
@@ -569,7 +569,7 @@ public sealed class AirAlarmSystem : EntitySystem
         _ui.TryCloseAll(uid, SharedAirAlarmInterfaceKey.Key);
     }
 
-    private void OnAtmosUpdate(EntityUid uid, AirAlarmComponent alarm, AtmosDeviceUpdateEvent args)
+    private void OnAtmosUpdate(EntityUid uid, AirAlarmComponent alarm, ref AtmosDeviceUpdateEvent args)
     {
         alarm.CurrentModeUpdater?.Update(uid);
     }
index efd67550ba1a9beb9c34b516221230172b389ae6..1fcb7734d8bad1a15e166d8c17cd6a6c6219e29b 100644 (file)
@@ -47,12 +47,12 @@ public sealed class AtmosMonitorSystem : EntitySystem
         SubscribeLocalEvent<AtmosMonitorComponent, AtmosDeviceEnabledEvent>(OnAtmosDeviceEnterAtmosphere);
     }
 
-    private void OnAtmosDeviceLeaveAtmosphere(EntityUid uid, AtmosMonitorComponent atmosMonitor, AtmosDeviceDisabledEvent args)
+    private void OnAtmosDeviceLeaveAtmosphere(EntityUid uid, AtmosMonitorComponent atmosMonitor, ref AtmosDeviceDisabledEvent args)
     {
         atmosMonitor.TileGas = null;
     }
 
-    private void OnAtmosDeviceEnterAtmosphere(EntityUid uid, AtmosMonitorComponent atmosMonitor, AtmosDeviceEnabledEvent args)
+    private void OnAtmosDeviceEnterAtmosphere(EntityUid uid, AtmosMonitorComponent atmosMonitor, ref AtmosDeviceEnabledEvent args)
     {
         atmosMonitor.TileGas = _atmosphereSystem.GetContainingMixture(uid, true);
     }
@@ -198,7 +198,7 @@ public sealed class AtmosMonitorSystem : EntitySystem
         }
     }
 
-    private void OnAtmosUpdate(EntityUid uid, AtmosMonitorComponent component, AtmosDeviceUpdateEvent args)
+    private void OnAtmosUpdate(EntityUid uid, AtmosMonitorComponent component, ref AtmosDeviceUpdateEvent args)
     {
         if (!this.IsPowered(uid, EntityManager))
             return;
index 9b37aaaf3e1016dbd83f5d99dc4660c1d9b1eb80..77bab4775ce3c9db29a778c895440de081dcc7c0 100644 (file)
@@ -24,7 +24,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             SubscribeLocalEvent<GasPassiveGateComponent, ExaminedEvent>(OnExamined);
         }
 
-        private void OnPassiveGateUpdated(EntityUid uid, GasPassiveGateComponent gate, AtmosDeviceUpdateEvent args)
+        private void OnPassiveGateUpdated(EntityUid uid, GasPassiveGateComponent gate, ref AtmosDeviceUpdateEvent args)
         {
             if (!EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer))
                 return;
index 75167dfbc25506b532762d3d1ee0384650c9cb70..49b69fc6739ab4306e413bf8e3ac2de74520969b 100644 (file)
@@ -63,7 +63,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             }
         }
 
-        private void OnPumpUpdated(EntityUid uid, GasPressurePumpComponent pump, AtmosDeviceUpdateEvent args)
+        private void OnPumpUpdated(EntityUid uid, GasPressurePumpComponent pump, ref AtmosDeviceUpdateEvent args)
         {
             if (!pump.Enabled
                 || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
@@ -94,7 +94,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             }
         }
 
-        private void OnPumpLeaveAtmosphere(EntityUid uid, GasPressurePumpComponent pump, AtmosDeviceDisabledEvent args)
+        private void OnPumpLeaveAtmosphere(EntityUid uid, GasPressurePumpComponent pump, ref AtmosDeviceDisabledEvent args)
         {
             pump.Enabled = false;
             UpdateAppearance(uid, pump);
index 5ee239936c934bf2000e478d13227b4ecc434509..fb35ddc34693518b8115471e3c23625840b994b0 100644 (file)
@@ -33,7 +33,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             SubscribeLocalEvent<GasRecyclerComponent, UpgradeExamineEvent>(OnUpgradeExamine);
         }
 
-        private void OnEnabled(EntityUid uid, GasRecyclerComponent comp, AtmosDeviceEnabledEvent args)
+        private void OnEnabled(EntityUid uid, GasRecyclerComponent comp, ref AtmosDeviceEnabledEvent args)
         {
             UpdateAppearance(uid, comp);
         }
@@ -109,7 +109,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             return alpha * (float)Math.Sqrt(inlet.Pressure - outlet.Pressure);
         }
 
-        private void OnDisabled(EntityUid uid, GasRecyclerComponent comp, AtmosDeviceDisabledEvent args)
+        private void OnDisabled(EntityUid uid, GasRecyclerComponent comp, ref AtmosDeviceDisabledEvent args)
         {
             comp.Reacting = false;
             UpdateAppearance(uid, comp);
index eb4fcf183e33228a498ad2166c15e6557be6c835..4ae0d70f5e7dce7e5b16b9b94bcb5e0a97cd23b5 100644 (file)
@@ -69,7 +69,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
                 args.PushMarkup(str);
         }
 
-        private void OnVolumePumpUpdated(EntityUid uid, GasVolumePumpComponent pump, AtmosDeviceUpdateEvent args)
+        private void OnVolumePumpUpdated(EntityUid uid, GasVolumePumpComponent pump, ref AtmosDeviceUpdateEvent args)
         {
             if (!pump.Enabled
                 || !TryComp(uid, out NodeContainerComponent? nodeContainer)
@@ -125,7 +125,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
             _ambientSoundSystem.SetAmbience(uid, removed.TotalMoles > 0f);
         }
 
-        private void OnVolumePumpLeaveAtmosphere(EntityUid uid, GasVolumePumpComponent pump, AtmosDeviceDisabledEvent args)
+        private void OnVolumePumpLeaveAtmosphere(EntityUid uid, GasVolumePumpComponent pump, ref AtmosDeviceDisabledEvent args)
         {
             pump.Enabled = false;
             UpdateAppearance(uid, pump);
index cf53bb8b6e8febf0f3cb4a8415e7739903a7cf87..361e3cbbeb228b3aabf4ac5df1761cdb47b31bd2 100644 (file)
@@ -1,60 +1,73 @@
-namespace Content.Server.Atmos.Piping.Components
+using Content.Server.Atmos.Components;
+
+namespace Content.Server.Atmos.Piping.Components;
+
+/// <summary>
+///     Component for atmos devices which are updated in line with atmos, as part of a <see cref="GridAtmosphereComponent"/>
+/// </summary>
+[RegisterComponent]
+public sealed partial class AtmosDeviceComponent : Component
 {
     /// <summary>
-    ///     Adds itself to a <see cref="IAtmosphereComponent"/> to be updated by.
+    ///     If true, this device must be anchored before it will receive any AtmosDeviceUpdateEvents.
     /// </summary>
-    [RegisterComponent]
-    public sealed partial class AtmosDeviceComponent : Component
-    {
-        /// <summary>
-        ///     If true, this device must be anchored before it will receive any AtmosDeviceUpdateEvents.
-        /// </summary>
-        [ViewVariables(VVAccess.ReadWrite)]
-        [DataField("requireAnchored")]
-        public bool RequireAnchored { get; private set; } = true;
-
-        /// <summary>
-        ///     If true, update even when there is no grid atmosphere. Normally, atmos devices only
-        ///     update when inside a grid atmosphere, because they work with gases in the environment
-        ///     and won't do anything useful if there is no environment. This is useful for devices
-        ///     like gas canisters whose contents can still react if the canister itself is not inside
-        ///     a grid atmosphere.
-        /// </summary>
-        [DataField("joinSystem")]
-        public bool JoinSystem { get; private set; } = false;
-
-        /// <summary>
-        ///     If non-null, the grid that this device is part of.
-        /// </summary>
-        public EntityUid? JoinedGrid { get; set; }
-
-        /// <summary>
-        ///     Indicates that a device is not on a grid atmosphere but still being updated.
-        /// </summary>
-        [ViewVariables]
-        public bool JoinedSystem { get; set; } = false;
-
-        [ViewVariables]
-        public TimeSpan LastProcess { get; set; } = TimeSpan.Zero;
-    }
+    [ViewVariables(VVAccess.ReadWrite)]
+    [DataField]
+    public bool RequireAnchored = true;
 
-    public sealed class AtmosDeviceUpdateEvent : EntityEventArgs
+    /// <summary>
+    ///     If true, update even when there is no grid atmosphere. Normally, atmos devices only
+    ///     update when inside a grid atmosphere, because they work with gases in the environment
+    ///     and won't do anything useful if there is no environment. This is useful for devices
+    ///     like gas canisters whose contents can still react if the canister itself is not inside
+    ///     a grid atmosphere.
+    /// </summary>
+    [DataField]
+    public bool JoinSystem = false;
+
+    /// <summary>
+    ///     If non-null, the grid that this device is part of.
+    /// </summary>
+    [DataField]
+    public EntityUid? JoinedGrid = null;
+
+    /// <summary>
+    ///     Indicates that a device is not on a grid atmosphere but still being updated.
+    /// </summary>
+    [ViewVariables]
+    public bool JoinedSystem = false;
+
+    [ViewVariables]
+    public TimeSpan LastProcess = TimeSpan.Zero;
+}
+
+/// <summary>
+/// Raised directed on an atmos device as part of the atmos update loop when the device should do processing.
+/// Use this for atmos devices instead of <see cref="EntitySystem.Update"/>.
+/// </summary>
+[ByRefEvent]
+public readonly struct AtmosDeviceUpdateEvent
+{
+    /// <summary>
+    /// Time elapsed since last update, in seconds. Multiply values used in the update handler
+    /// by this number to make them tickrate-invariant. Use this number instead of AtmosphereSystem.AtmosTime.
+    /// </summary>
+    public readonly float dt;
+
+    public AtmosDeviceUpdateEvent(float dt)
     {
-        /// <summary>
-        /// Time elapsed since last update, in seconds. Multiply values used in the update handler
-        /// by this number to make them tickrate-invariant. Use this number instead of AtmosphereSystem.AtmosTime.
-        /// </summary>
-        public float dt;
-
-        public AtmosDeviceUpdateEvent(float dt)
-        {
-            this.dt = dt;
-        }
+        this.dt = dt;
     }
+}
 
-    public sealed class AtmosDeviceEnabledEvent : EntityEventArgs
-    {}
+/// <summary>
+///     Raised directed on an atmos device when it is enabled.
+/// </summary>
+[ByRefEvent]
+public record struct AtmosDeviceEnabledEvent;
 
-    public sealed class AtmosDeviceDisabledEvent : EntityEventArgs
-    {}
-}
+/// <summary>
+///     Raised directed on an atmos device when it is enabled.
+/// </summary>
+[ByRefEvent]
+public record struct AtmosDeviceDisabledEvent;
index ee7cf37096812172856bfd0b82df3eb8ea2f4084..f4da68ab5313266b06448b2505f7fe6666c57574 100644 (file)
@@ -16,6 +16,9 @@ namespace Content.Server.Atmos.Piping.EntitySystems
         // Set of atmos devices that are off-grid but have JoinSystem set.
         private readonly HashSet<Entity<AtmosDeviceComponent>> _joinedDevices = new();
 
+        private static AtmosDeviceDisabledEvent _disabledEv = new();
+        private static AtmosDeviceEnabledEvent _enabledEv = new();
+
         public override void Initialize()
         {
             base.Initialize();
@@ -45,7 +48,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
             }
 
             component.LastProcess = _gameTiming.CurTime;
-            RaiseLocalEvent(ent, new AtmosDeviceEnabledEvent());
+            RaiseLocalEvent(ent, ref _enabledEv);
         }
 
         public void LeaveAtmosphere(Entity<AtmosDeviceComponent> ent)
@@ -66,7 +69,7 @@ namespace Content.Server.Atmos.Piping.EntitySystems
             }
 
             component.LastProcess = TimeSpan.Zero;
-            RaiseLocalEvent(ent, new AtmosDeviceDisabledEvent());
+            RaiseLocalEvent(ent, ref _disabledEv);
         }
 
         public void RejoinAtmosphere(Entity<AtmosDeviceComponent> component)
@@ -116,9 +119,10 @@ namespace Content.Server.Atmos.Piping.EntitySystems
             _timer -= _atmosphereSystem.AtmosTime;
 
             var time = _gameTiming.CurTime;
+            var ev = new AtmosDeviceUpdateEvent(_atmosphereSystem.AtmosTime);
             foreach (var device in _joinedDevices)
             {
-                RaiseLocalEvent(device, new AtmosDeviceUpdateEvent(_atmosphereSystem.AtmosTime));
+                RaiseLocalEvent(device, ref ev);
                 device.Comp.LastProcess = time;
             }
         }
index 62df033f9324ecb3d702ea8f53990ef594d581a3..492d8cb0bd8d8d15949a48b67aa1b2eb6066c41e 100644 (file)
@@ -50,7 +50,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             UpdateAppearance(uid, filter);
         }
 
-        private void OnFilterUpdated(EntityUid uid, GasFilterComponent filter, AtmosDeviceUpdateEvent args)
+        private void OnFilterUpdated(EntityUid uid, GasFilterComponent filter, ref AtmosDeviceUpdateEvent args)
         {
             if (!filter.Enabled
                 || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
@@ -90,7 +90,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             _atmosphereSystem.Merge(outletNode.Air, removed);
         }
 
-        private void OnFilterLeaveAtmosphere(EntityUid uid, GasFilterComponent filter, AtmosDeviceDisabledEvent args)
+        private void OnFilterLeaveAtmosphere(EntityUid uid, GasFilterComponent filter, ref AtmosDeviceDisabledEvent args)
         {
             filter.Enabled = false;
 
index f6ad51fb24c4ee993ed44b4102802aabaaabf6a2..6d03c8624816e48a34afbdef9a263fc4eaaa1d19 100644 (file)
@@ -50,7 +50,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             UpdateAppearance(uid, mixer);
         }
 
-        private void OnMixerUpdated(EntityUid uid, GasMixerComponent mixer, AtmosDeviceUpdateEvent args)
+        private void OnMixerUpdated(EntityUid uid, GasMixerComponent mixer, ref AtmosDeviceUpdateEvent args)
         {
             // TODO ATMOS: Cache total moles since it's expensive.
 
@@ -138,7 +138,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
                 _ambientSoundSystem.SetAmbience(uid, true);
         }
 
-        private void OnMixerLeaveAtmosphere(EntityUid uid, GasMixerComponent mixer, AtmosDeviceDisabledEvent args)
+        private void OnMixerLeaveAtmosphere(EntityUid uid, GasMixerComponent mixer, ref AtmosDeviceDisabledEvent args)
         {
             mixer.Enabled = false;
 
index e805a4d0aedac8d79f0b2604e7a26dfb34345486..2c2f1584a53534c90e2d769b23bbe430e5bd3ac1 100644 (file)
@@ -31,7 +31,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             UpdateAppearance(uid, comp);
         }
 
-        private void OnUpdate(EntityUid uid, PressureControlledValveComponent comp, AtmosDeviceUpdateEvent args)
+        private void OnUpdate(EntityUid uid, PressureControlledValveComponent comp, ref AtmosDeviceUpdateEvent args)
         {
             if (!EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer)
                 || !EntityManager.TryGetComponent(uid, out AtmosDeviceComponent? device)
@@ -79,7 +79,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
             _atmosphereSystem.Merge(outletNode.Air, removed);
         }
 
-        private void OnFilterLeaveAtmosphere(EntityUid uid, PressureControlledValveComponent comp, AtmosDeviceDisabledEvent args)
+        private void OnFilterLeaveAtmosphere(EntityUid uid, PressureControlledValveComponent comp, ref AtmosDeviceDisabledEvent args)
         {
             comp.Enabled = false;
             UpdateAppearance(uid, comp);
index 8ac91ce0efce5e07d0f5f9b2846bf041a4233cb8..e1e7b2a7013decf5b125fa4167a2b27142d7cd30 100644 (file)
@@ -134,7 +134,7 @@ public sealed class GasCanisterSystem : EntitySystem
 
     private void OnCanisterChangeReleaseValve(EntityUid uid, GasCanisterComponent canister, GasCanisterChangeReleaseValveMessage args)
     {
-        var impact = LogImpact.High; 
+        var impact = LogImpact.High;
         // filling a jetpack with plasma is less important than filling a room with it
         impact = canister.GasTankSlot.HasItem ? LogImpact.Medium : LogImpact.High;
 
@@ -152,7 +152,7 @@ public sealed class GasCanisterSystem : EntitySystem
         DirtyUI(uid, canister);
     }
 
-    private void OnCanisterUpdated(EntityUid uid, GasCanisterComponent canister, AtmosDeviceUpdateEvent args)
+    private void OnCanisterUpdated(EntityUid uid, GasCanisterComponent canister, ref AtmosDeviceUpdateEvent args)
     {
         _atmos.React(canister.Air, canister);
 
@@ -167,7 +167,7 @@ public sealed class GasCanisterSystem : EntitySystem
         {
             MixContainerWithPipeNet(canister.Air, net.Air);
         }
-        
+
         // Release valve is open, release gas.
         if (canister.ReleaseValve)
         {
@@ -250,9 +250,9 @@ public sealed class GasCanisterSystem : EntitySystem
         }
 
         // Preventing inserting a tank since if its locked you cant remove it.
-        if (!CheckLocked(uid, component, args.User.Value)) 
+        if (!CheckLocked(uid, component, args.User.Value))
             return;
-        
+
         args.Cancelled = true;
     }
 
index 8df1bb53658a26361141b900d5ddcf006d7e7746..f9ed614d9cf2cdce913a3ef226cfdb07883ec908 100644 (file)
@@ -27,7 +27,7 @@ public sealed class GasCondenserSystem : EntitySystem
         SubscribeLocalEvent<GasCondenserComponent, AtmosDeviceUpdateEvent>(OnCondenserUpdated);
     }
 
-    private void OnCondenserUpdated(EntityUid uid, GasCondenserComponent component, AtmosDeviceUpdateEvent args)
+    private void OnCondenserUpdated(EntityUid uid, GasCondenserComponent component, ref AtmosDeviceUpdateEvent args)
     {
         if (!(_power.IsPowered(uid) && TryComp<ApcPowerReceiverComponent>(uid, out var receiver))
             || !TryComp<NodeContainerComponent>(uid, out var nodeContainer)
index 45771b49d3c5c950c2cf0e8d3ead02d541baa41a..8029a0955651f1e7426e9560577e615ebefd891a 100644 (file)
@@ -45,7 +45,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             _appearance.SetData(uid, OutletInjectorVisuals.Enabled, component.Enabled, appearance);
         }
 
-        private void OnOutletInjectorUpdated(EntityUid uid, GasOutletInjectorComponent injector, AtmosDeviceUpdateEvent args)
+        private void OnOutletInjectorUpdated(EntityUid uid, GasOutletInjectorComponent injector, ref AtmosDeviceUpdateEvent args)
         {
             if (!injector.Enabled)
                 return;
index f0a3ee777bc45c9ca7a3085c9e196cac67e8fecd..c8fd23d466a1a2b6eaa42cfd758df09d052feb2d 100644 (file)
@@ -22,7 +22,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             SubscribeLocalEvent<GasPassiveVentComponent, AtmosDeviceUpdateEvent>(OnPassiveVentUpdated);
         }
 
-        private void OnPassiveVentUpdated(EntityUid uid, GasPassiveVentComponent vent, AtmosDeviceUpdateEvent args)
+        private void OnPassiveVentUpdated(EntityUid uid, GasPassiveVentComponent vent, ref AtmosDeviceUpdateEvent args)
         {
             var environment = _atmosphereSystem.GetContainingMixture(uid, true, true);
 
index 4140eb2a93f29d27e633adf0145a60d1400d1bc6..46e3b3c1721da05cd731e7cb1c7175a2587793d8 100644 (file)
@@ -46,7 +46,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             SubscribeLocalEvent<GasThermoMachineComponent, DeviceNetworkPacketEvent>(OnPacketRecv);
         }
 
-        private void OnThermoMachineUpdated(EntityUid uid, GasThermoMachineComponent thermoMachine, AtmosDeviceUpdateEvent args)
+        private void OnThermoMachineUpdated(EntityUid uid, GasThermoMachineComponent thermoMachine, ref AtmosDeviceUpdateEvent args)
         {
             if (!(_power.IsPowered(uid) && TryComp<ApcPowerReceiverComponent>(uid, out var receiver))
                 || !TryComp<NodeContainerComponent>(uid, out var nodeContainer)
index 2c95887198e8dad596e2061049c08458ee262cb5..a35c6b1aa6e3e2c549db370dddc8aa1db531aac9 100644 (file)
@@ -51,7 +51,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             SubscribeLocalEvent<GasVentPumpComponent, WeldableChangedEvent>(OnWeldChanged);
         }
 
-        private void OnGasVentPumpUpdated(EntityUid uid, GasVentPumpComponent vent, AtmosDeviceUpdateEvent args)
+        private void OnGasVentPumpUpdated(EntityUid uid, GasVentPumpComponent vent, ref AtmosDeviceUpdateEvent args)
         {
             //Bingo waz here
             if (_weldable.IsWelded(uid))
@@ -165,12 +165,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             }
         }
 
-        private void OnGasVentPumpLeaveAtmosphere(EntityUid uid, GasVentPumpComponent component, AtmosDeviceDisabledEvent args)
+        private void OnGasVentPumpLeaveAtmosphere(EntityUid uid, GasVentPumpComponent component, ref AtmosDeviceDisabledEvent args)
         {
             UpdateState(uid, component);
         }
 
-        private void OnGasVentPumpEnterAtmosphere(EntityUid uid, GasVentPumpComponent component, AtmosDeviceEnabledEvent args)
+        private void OnGasVentPumpEnterAtmosphere(EntityUid uid, GasVentPumpComponent component, ref AtmosDeviceEnabledEvent args)
         {
             UpdateState(uid, component);
         }
index 37c8358a6f1962b1ce1a333e2d87e4cda93f11f6..ecf7d1d0b45a7b7df28608fbc427d9fa8e10fe49 100644 (file)
@@ -45,7 +45,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
             SubscribeLocalEvent<GasVentScrubberComponent, WeldableChangedEvent>(OnWeldChanged);
         }
 
-        private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args)
+        private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, ref AtmosDeviceUpdateEvent args)
         {
             if (_weldable.IsWelded(uid))
             {
index 3e72b75f14f6ed8b192bd0b5832ba6b21afb5c1b..922943f25fe7fdc59a575f3027f64b583dfaa65b 100644 (file)
@@ -48,7 +48,7 @@ namespace Content.Server.Atmos.Portable
             return component.Air.Pressure >= component.MaxPressure;
         }
 
-        private void OnDeviceUpdated(EntityUid uid, PortableScrubberComponent component, AtmosDeviceUpdateEvent args)
+        private void OnDeviceUpdated(EntityUid uid, PortableScrubberComponent component, ref AtmosDeviceUpdateEvent args)
         {
             if (!TryComp(uid, out AtmosDeviceComponent? device))
                 return;
index 82f7b9cb0a00697540d776f917f7ab12c9d73211..b083c480f6ce68b794fdd9ac9d9486c65c06af2f 100644 (file)
@@ -236,7 +236,7 @@ public sealed partial class CryoPodSystem: SharedCryoPodSystem
 
     #region Atmos handler
 
-    private void OnCryoPodUpdateAtmosphere(EntityUid uid, CryoPodComponent cryoPod, AtmosDeviceUpdateEvent args)
+    private void OnCryoPodUpdateAtmosphere(EntityUid uid, CryoPodComponent cryoPod, ref AtmosDeviceUpdateEvent args)
     {
         if (!TryComp(uid, out NodeContainerComponent? nodeContainer))
             return;
index 1fb844ac5b1c0d255d011f1de9ddc5d83e578615..54f40a1bf34fa4589aecb2a37a474e6e778cb9f0 100644 (file)
@@ -97,7 +97,7 @@ public sealed class TegSystem : EntitySystem
         }
     }
 
-    private void GeneratorUpdate(EntityUid uid, TegGeneratorComponent component, AtmosDeviceUpdateEvent args)
+    private void GeneratorUpdate(EntityUid uid, TegGeneratorComponent component, ref AtmosDeviceUpdateEvent args)
     {
         var tegGroup = GetNodeGroup(uid);
         if (tegGroup is not { IsFullyBuilt: true })
index 603cbd769aecaf374f52b45a603a43adbbd2642e..c61599edfc9e7047a2ee7070aca90ddc63fa324e 100644 (file)
@@ -22,7 +22,7 @@ public sealed class GasPowerReceiverSystem : EntitySystem
         SubscribeLocalEvent<GasPowerReceiverComponent, AtmosDeviceUpdateEvent>(OnDeviceUpdated);
     }
 
-    private void OnDeviceUpdated(EntityUid uid, GasPowerReceiverComponent component, AtmosDeviceUpdateEvent args)
+    private void OnDeviceUpdated(EntityUid uid, GasPowerReceiverComponent component, ref AtmosDeviceUpdateEvent args)
     {
         var timeDelta = args.dt;