From: jicksaw Date: Sat, 22 Apr 2023 11:06:45 +0000 (+0300) Subject: Remove stun and knockdown status effects before applying sleep (#15460) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=415eca285c46014c832ce25bb557429300d1a5d5;p=space-station-14.git Remove stun and knockdown status effects before applying sleep (#15460) --- 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);