diff --git a/Content.Server/Body/Systems/LungSystem.cs b/Content.Server/Body/Systems/LungSystem.cs index 954b553227..1843ae033e 100644 --- a/Content.Server/Body/Systems/LungSystem.cs +++ b/Content.Server/Body/Systems/LungSystem.cs @@ -53,22 +53,18 @@ public sealed class LungSystem : EntitySystem private void OnMaskToggled(Entity ent, ref ItemMaskToggledEvent args) { - // toggle breath tool connection (skip during equip since that is handled in LungSystem) - if (args.IsEquip) + if (args.IsToggled || args.IsEquip) { - if (args.IsToggled) - { - _atmos.DisconnectInternals(ent.Comp); - } - else - { - ent.Comp.IsFunctional = true; + _atmos.DisconnectInternals(ent.Comp); + } + else + { + ent.Comp.IsFunctional = true; - if (TryComp(args.Wearer, out InternalsComponent? internals)) - { - ent.Comp.ConnectedInternalsEntity = args.Wearer; - _internals.ConnectBreathTool((args.Wearer, internals), ent); - } + if (TryComp(args.Wearer, out InternalsComponent? internals)) + { + ent.Comp.ConnectedInternalsEntity = args.Wearer; + _internals.ConnectBreathTool((args.Wearer, internals), ent); } } } diff --git a/Content.Shared/Clothing/EntitySystems/MaskSystem.cs b/Content.Shared/Clothing/EntitySystems/MaskSystem.cs index 50cf3afe50..6c135e1a07 100644 --- a/Content.Shared/Clothing/EntitySystems/MaskSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/MaskSystem.cs @@ -3,6 +3,7 @@ using Content.Shared.Clothing.Components; using Content.Shared.Inventory; using Content.Shared.Inventory.Events; using Content.Shared.Popups; +using Robust.Shared.Timing; namespace Content.Shared.Clothing.EntitySystems; @@ -11,6 +12,7 @@ public sealed class MaskSystem : EntitySystem [Dependency] private readonly SharedActionsSystem _actionSystem = default!; [Dependency] private readonly InventorySystem _inventorySystem = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + [Dependency] private readonly IGameTiming _timing = default!; public override void Initialize() { @@ -30,7 +32,7 @@ public sealed class MaskSystem : EntitySystem private void OnToggleMask(Entity ent, ref ToggleMaskEvent args) { var (uid, mask) = ent; - if (mask.ToggleActionEntity == null) + if (mask.ToggleActionEntity == null || !_timing.IsFirstTimePredicted) return; if (!_inventorySystem.TryGetSlotEntity(args.Performer, "mask", out var existing) || !uid.Equals(existing))