From 415eca285c46014c832ce25bb557429300d1a5d5 Mon Sep 17 00:00:00 2001 From: jicksaw Date: Sat, 22 Apr 2023 14:06:45 +0300 Subject: [PATCH] Remove stun and knockdown status effects before applying sleep (#15460) --- Content.Server/Bed/Sleep/SleepingSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Server/Bed/Sleep/SleepingSystem.cs b/Content.Server/Bed/Sleep/SleepingSystem.cs index c52bd480ec..b349b02065 100644 --- a/Content.Server/Bed/Sleep/SleepingSystem.cs +++ b/Content.Server/Bed/Sleep/SleepingSystem.cs @@ -10,6 +10,7 @@ using Content.Shared.IdentityManagement; using Content.Shared.Interaction; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; +using Content.Shared.StatusEffect; using Content.Shared.Slippery; using Content.Shared.Stunnable; using Content.Shared.Verbs; @@ -29,6 +30,7 @@ namespace Content.Server.Bed.Sleep [Dependency] private readonly ActionsSystem _actionsSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; public override void Initialize() { @@ -53,6 +55,10 @@ namespace Content.Server.Bed.Sleep _prototypeManager.TryIndex("Wake", out var wakeAction); if (args.FellAsleep) { + // Expiring status effects would remove the components needed for sleeping + _statusEffectsSystem.TryRemoveStatusEffect(uid, "Stun"); + _statusEffectsSystem.TryRemoveStatusEffect(uid, "KnockedDown"); + EnsureComp(uid); EnsureComp(uid); -- 2.51.2