[RegisterComponent]
public sealed partial class GasVentPumpComponent : Component
{
+ /// <summary>
+ /// Identifies if the device is enabled by an air alarm. Does not indicate if the device is powered.
+ /// By default, all air vents start enabled, whether linked to an alarm or not.
+ /// </summary>
[ViewVariables(VVAccess.ReadWrite)]
- public bool Enabled { get; set; } = false;
+ public bool Enabled { get; set; } = true;
[ViewVariables]
public bool IsDirty { get; set; } = false;
[Access(typeof(GasVentScrubberSystem))]
public sealed partial class GasVentScrubberComponent : Component
{
+ /// <summary>
+ /// Identifies if the device is enabled by an air alarm. Does not indicate if the device is powered.
+ /// By default, all air scrubbers start enabled, whether linked to an alarm or not.
+ /// </summary>
[DataField]
- public bool Enabled { get; set; } = false;
+ public bool Enabled { get; set; } = true;
[DataField]
public bool IsDirty { get; set; } = false;
using Content.Server.DeviceNetwork.Systems;
using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.Nodes;
+using Content.Server.Power.Components;
+using Content.Server.Power.EntitySystems;
using Content.Shared.Administration.Logs;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Monitor;
[Dependency] private readonly SharedToolSystem _toolSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly IGameTiming _timing = default!;
+ [Dependency] private readonly PowerReceiverSystem _powerReceiverSystem = default!;
public override void Initialize()
{
base.Initialize();
{
//Bingo waz here
if (_weldable.IsWelded(uid))
- {
return;
- }
+
+ if (!_powerReceiverSystem.IsPowered(uid))
+ return;
var nodeName = vent.PumpDirection switch
{
private void OnPowerChanged(EntityUid uid, GasVentPumpComponent component, ref PowerChangedEvent args)
{
- component.Enabled = args.Powered;
UpdateState(uid, component);
}
_ambientSoundSystem.SetAmbience(uid, false);
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Welded, appearance);
}
- else if (!vent.Enabled)
+ else if (!_powerReceiverSystem.IsPowered(uid) || !vent.Enabled)
{
_ambientSoundSystem.SetAmbience(uid, false);
_appearance.SetData(uid, VentPumpVisuals.State, VentPumpState.Off, appearance);
using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.Nodes;
using Content.Server.Power.Components;
+using Content.Server.Power.EntitySystems;
using Content.Shared.Administration.Logs;
using Content.Shared.Atmos;
using Content.Shared.Atmos.Piping.Unary.Visuals;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly WeldableSystem _weldable = default!;
+ [Dependency] private readonly PowerReceiverSystem _powerReceiverSystem = default!;
public override void Initialize()
{
var timeDelta = args.dt;
+ if (!_powerReceiverSystem.IsPowered(uid))
+ return;
+
if (!scrubber.Enabled || !_nodeContainer.TryGetNode(uid, scrubber.OutletName, out PipeNode? outlet))
return;
private void OnPowerChanged(EntityUid uid, GasVentScrubberComponent component, ref PowerChangedEvent args)
{
- component.Enabled = args.Powered;
UpdateState(uid, component);
}
_ambientSoundSystem.SetAmbience(uid, false);
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Welded, appearance);
}
- else if (!scrubber.Enabled)
+ else if (!_powerReceiverSystem.IsPowered(uid) || !scrubber.Enabled)
{
_ambientSoundSystem.SetAmbience(uid, false);
_appearance.SetData(uid, ScrubberVisuals.State, ScrubberState.Off, appearance);