diff --git a/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs b/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs index 6230a184d7..416045fc5e 100644 --- a/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirFilterSystem.cs @@ -25,7 +25,7 @@ public sealed class AirFilterSystem : EntitySystem SubscribeLocalEvent(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; diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs index ad0d409a4b..4f8df0af67 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Processing.cs @@ -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) diff --git a/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs b/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs index 2541d98a7e..a71174d4d3 100644 --- a/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs +++ b/Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs @@ -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) diff --git a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs index 190ac9d5c9..b65d855680 100644 --- a/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AirAlarmSystem.cs @@ -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); } diff --git a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs index efd67550ba..1fcb7734d8 100644 --- a/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs +++ b/Content.Server/Atmos/Monitor/Systems/AtmosMonitoringSystem.cs @@ -47,12 +47,12 @@ public sealed class AtmosMonitorSystem : EntitySystem SubscribeLocalEvent(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; diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs index 9b37aaaf3e..77bab4775c 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPassiveGateSystem.cs @@ -24,7 +24,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems SubscribeLocalEvent(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; diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs index 75167dfbc2..49b69fc673 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs @@ -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); diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasRecyclerSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasRecyclerSystem.cs index 5ee239936c..fb35ddc346 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasRecyclerSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasRecyclerSystem.cs @@ -33,7 +33,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems SubscribeLocalEvent(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); diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs index eb4fcf183e..4ae0d70f5e 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasVolumePumpSystem.cs @@ -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); diff --git a/Content.Server/Atmos/Piping/Components/AtmosDeviceComponent.cs b/Content.Server/Atmos/Piping/Components/AtmosDeviceComponent.cs index cf53bb8b6e..361e3cbbeb 100644 --- a/Content.Server/Atmos/Piping/Components/AtmosDeviceComponent.cs +++ b/Content.Server/Atmos/Piping/Components/AtmosDeviceComponent.cs @@ -1,60 +1,73 @@ -namespace Content.Server.Atmos.Piping.Components +using Content.Server.Atmos.Components; + +namespace Content.Server.Atmos.Piping.Components; + +/// +/// Component for atmos devices which are updated in line with atmos, as part of a +/// +[RegisterComponent] +public sealed partial class AtmosDeviceComponent : Component { /// - /// Adds itself to a to be updated by. + /// If true, this device must be anchored before it will receive any AtmosDeviceUpdateEvents. /// - [RegisterComponent] - public sealed partial class AtmosDeviceComponent : Component - { - /// - /// If true, this device must be anchored before it will receive any AtmosDeviceUpdateEvents. - /// - [ViewVariables(VVAccess.ReadWrite)] - [DataField("requireAnchored")] - public bool RequireAnchored { get; private set; } = true; + [ViewVariables(VVAccess.ReadWrite)] + [DataField] + public bool RequireAnchored = true; - /// - /// 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. - /// - [DataField("joinSystem")] - public bool JoinSystem { get; private set; } = false; + /// + /// 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. + /// + [DataField] + public bool JoinSystem = false; - /// - /// If non-null, the grid that this device is part of. - /// - public EntityUid? JoinedGrid { get; set; } + /// + /// If non-null, the grid that this device is part of. + /// + [DataField] + public EntityUid? JoinedGrid = null; - /// - /// Indicates that a device is not on a grid atmosphere but still being updated. - /// - [ViewVariables] - public bool JoinedSystem { get; set; } = false; + /// + /// Indicates that a device is not on a grid atmosphere but still being updated. + /// + [ViewVariables] + public bool JoinedSystem = false; - [ViewVariables] - public TimeSpan LastProcess { get; set; } = TimeSpan.Zero; - } - - public sealed class AtmosDeviceUpdateEvent : EntityEventArgs - { - /// - /// 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. - /// - public float dt; - - public AtmosDeviceUpdateEvent(float dt) - { - this.dt = dt; - } - } - - public sealed class AtmosDeviceEnabledEvent : EntityEventArgs - {} - - public sealed class AtmosDeviceDisabledEvent : EntityEventArgs - {} + [ViewVariables] + public TimeSpan LastProcess = TimeSpan.Zero; } + +/// +/// 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 . +/// +[ByRefEvent] +public readonly struct AtmosDeviceUpdateEvent +{ + /// + /// 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. + /// + public readonly float dt; + + public AtmosDeviceUpdateEvent(float dt) + { + this.dt = dt; + } +} + +/// +/// Raised directed on an atmos device when it is enabled. +/// +[ByRefEvent] +public record struct AtmosDeviceEnabledEvent; + +/// +/// Raised directed on an atmos device when it is enabled. +/// +[ByRefEvent] +public record struct AtmosDeviceDisabledEvent; diff --git a/Content.Server/Atmos/Piping/EntitySystems/AtmosDeviceSystem.cs b/Content.Server/Atmos/Piping/EntitySystems/AtmosDeviceSystem.cs index ee7cf37096..f4da68ab53 100644 --- a/Content.Server/Atmos/Piping/EntitySystems/AtmosDeviceSystem.cs +++ b/Content.Server/Atmos/Piping/EntitySystems/AtmosDeviceSystem.cs @@ -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> _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 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 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; } } diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs index 62df033f93..492d8cb0bd 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs @@ -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; diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs index f6ad51fb24..6d03c86248 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasMixerSystem.cs @@ -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; diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/PressureControlledValveSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/PressureControlledValveSystem.cs index e805a4d0ae..2c2f1584a5 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/PressureControlledValveSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/PressureControlledValveSystem.cs @@ -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); diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs index 8ac91ce0ef..e1e7b2a701 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCanisterSystem.cs @@ -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; } diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCondenserSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCondenserSystem.cs index 8df1bb5365..f9ed614d9c 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCondenserSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasCondenserSystem.cs @@ -27,7 +27,7 @@ public sealed class GasCondenserSystem : EntitySystem SubscribeLocalEvent(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(uid, out var receiver)) || !TryComp(uid, out var nodeContainer) diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasOutletInjectorSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasOutletInjectorSystem.cs index 45771b49d3..8029a09556 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasOutletInjectorSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasOutletInjectorSystem.cs @@ -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; diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasPassiveVentSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasPassiveVentSystem.cs index f0a3ee777b..c8fd23d466 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasPassiveVentSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasPassiveVentSystem.cs @@ -22,7 +22,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems SubscribeLocalEvent(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); diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs index 4140eb2a93..46e3b3c172 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs @@ -46,7 +46,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems SubscribeLocalEvent(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(uid, out var receiver)) || !TryComp(uid, out var nodeContainer) diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs index 2c95887198..a35c6b1aa6 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs @@ -51,7 +51,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems SubscribeLocalEvent(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); } diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs index 37c8358a6f..ecf7d1d0b4 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs @@ -45,7 +45,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems SubscribeLocalEvent(OnWeldChanged); } - private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args) + private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, ref AtmosDeviceUpdateEvent args) { if (_weldable.IsWelded(uid)) { diff --git a/Content.Server/Atmos/Portable/PortableScrubberSystem.cs b/Content.Server/Atmos/Portable/PortableScrubberSystem.cs index 3e72b75f14..922943f25f 100644 --- a/Content.Server/Atmos/Portable/PortableScrubberSystem.cs +++ b/Content.Server/Atmos/Portable/PortableScrubberSystem.cs @@ -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; diff --git a/Content.Server/Medical/CryoPodSystem.cs b/Content.Server/Medical/CryoPodSystem.cs index 82f7b9cb0a..b083c480f6 100644 --- a/Content.Server/Medical/CryoPodSystem.cs +++ b/Content.Server/Medical/CryoPodSystem.cs @@ -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; diff --git a/Content.Server/Power/Generation/Teg/TegSystem.cs b/Content.Server/Power/Generation/Teg/TegSystem.cs index 1fb844ac5b..54f40a1bf3 100644 --- a/Content.Server/Power/Generation/Teg/TegSystem.cs +++ b/Content.Server/Power/Generation/Teg/TegSystem.cs @@ -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 }) diff --git a/Content.Server/Power/Generator/GasPowerReceiverSystem.cs b/Content.Server/Power/Generator/GasPowerReceiverSystem.cs index 603cbd769a..c61599edfc 100644 --- a/Content.Server/Power/Generator/GasPowerReceiverSystem.cs +++ b/Content.Server/Power/Generator/GasPowerReceiverSystem.cs @@ -22,7 +22,7 @@ public sealed class GasPowerReceiverSystem : EntitySystem SubscribeLocalEvent(OnDeviceUpdated); } - private void OnDeviceUpdated(EntityUid uid, GasPowerReceiverComponent component, AtmosDeviceUpdateEvent args) + private void OnDeviceUpdated(EntityUid uid, GasPowerReceiverComponent component, ref AtmosDeviceUpdateEvent args) { var timeDelta = args.dt;