From c261cc21a07827248d5d706fcf1916580b277b45 Mon Sep 17 00:00:00 2001 From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Sun, 11 May 2025 18:49:22 +0200 Subject: [PATCH] [HOTFIX] Ensure that mobs wake up when zombified (#37346) zombie sleep fix --- Content.Shared/Bed/Sleep/SleepingSystem.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Content.Shared/Bed/Sleep/SleepingSystem.cs b/Content.Shared/Bed/Sleep/SleepingSystem.cs index d0c6c753de..916bab09e2 100644 --- a/Content.Shared/Bed/Sleep/SleepingSystem.cs +++ b/Content.Shared/Bed/Sleep/SleepingSystem.cs @@ -21,6 +21,7 @@ using Content.Shared.StatusEffect; using Content.Shared.Stunnable; using Content.Shared.Traits.Assorted; using Content.Shared.Verbs; +using Content.Shared.Zombies; using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Timing; @@ -51,6 +52,7 @@ public sealed partial class SleepingSystem : EntitySystem SubscribeLocalEvent(OnSleepAction); SubscribeLocalEvent(OnDamageChanged); + SubscribeLocalEvent(OnZombified); SubscribeLocalEvent(OnMobStateChanged); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnSpeakAttempt); @@ -219,6 +221,16 @@ public sealed partial class SleepingSystem : EntitySystem TryWaking((ent, ent.Comp)); } + /// + /// Wake up on being zombified. + /// In some cases, zombification might theoretically occur without a mob state change or being damaged + /// + /// //TODO Perhaps a generic component should be introduced that guarantees that a mob will wake up immediately and can't go to sleep again + private void OnZombified(Entity ent, ref EntityZombifiedEvent args) + { + TryWaking((ent, ent.Comp), true); + } + /// /// In crit, we wake up if we are not being forced to sleep. /// And, you can't sleep when dead... -- 2.51.2