diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs index 6fb6d3f505..80bd7c39e0 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs @@ -11,6 +11,7 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.Nodes; using Content.Server.Power.Components; +using Content.Server.Tools.Systems; using Content.Shared.Atmos; using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Piping.Unary.Components; @@ -46,6 +47,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems SubscribeLocalEvent(OnExamine); SubscribeLocalEvent(OnSignalReceived); SubscribeLocalEvent(OnAnalyzed); + SubscribeLocalEvent(OnWeldChanged); } private void OnGasVentPumpUpdated(EntityUid uid, GasVentPumpComponent vent, AtmosDeviceUpdateEvent args) @@ -253,7 +255,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems return; _ambientSoundSystem.SetAmbience(uid, true); - if (!vent.Enabled) + if (vent.Welded) + { + _ambientSoundSystem.SetAmbience(uid, false); + _appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Welded, appearance); + } + else if (!vent.Enabled) { _ambientSoundSystem.SetAmbience(uid, false); _appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Off, appearance); @@ -266,11 +273,6 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems { _appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.In, appearance); } - else if (vent.Welded) - { - _ambientSoundSystem.SetAmbience(uid, false); - _appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Welded, appearance); - } } private void OnExamine(EntityUid uid, GasVentPumpComponent component, ExaminedEvent args) @@ -308,5 +310,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems args.GasMixtures = gasMixDict; } + + private void OnWeldChanged(EntityUid uid, GasVentPumpComponent component, WeldableChangedEvent args) + { + var isWelded = args.IsWelded; + component.Welded = isWelded; + UpdateState(uid, component); + } } } diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs index fda58f07b9..3d05e6e1cd 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs @@ -10,6 +10,7 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.Nodes; using Content.Server.Power.Components; +using Content.Server.Tools.Systems; using Content.Shared.Atmos; using Content.Shared.Atmos.Piping.Unary.Visuals; using Content.Shared.Atmos.Monitor; @@ -40,6 +41,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems SubscribeLocalEvent(OnAtmosAlarm); SubscribeLocalEvent(OnPowerChanged); SubscribeLocalEvent(OnPacketRecv); + SubscribeLocalEvent(OnWeldChanged); } private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args) @@ -183,7 +185,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems return; _ambientSoundSystem.SetAmbience(uid, true); - if (!scrubber.Enabled) + if (scrubber.Welded) + { + _ambientSoundSystem.SetAmbience(uid, false); + _appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Welded, appearance); + } + else if (!scrubber.Enabled) { _ambientSoundSystem.SetAmbience(uid, false); _appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Off, appearance); @@ -196,11 +203,13 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems { _appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Siphon, appearance); } - else if (scrubber.Welded) - { - _ambientSoundSystem.SetAmbience(uid, false); - _appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Welded, appearance); - } + } + + private void OnWeldChanged(EntityUid uid, GasVentScrubberComponent component, WeldableChangedEvent args) + { + var isWelded = args.IsWelded; + component.Welded = isWelded; + UpdateState(uid, component); } } } diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml index f86c413a2b..c4282a2d4d 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml @@ -83,6 +83,7 @@ range: 5 sound: path: /Audio/Ambience/Objects/gas_vent.ogg + - type: Weldable - type: entity parent: GasUnaryBase @@ -173,6 +174,7 @@ range: 5 sound: path: /Audio/Ambience/Objects/gas_vent.ogg + - type: Weldable - type: entity parent: GasUnaryBase