From 71b2cf221f641e26f39e5389a65cfb59cd98b791 Mon Sep 17 00:00:00 2001 From: keronshb <54602815+keronshb@users.noreply.github.com> Date: Sat, 12 Nov 2022 22:36:32 -0500 Subject: [PATCH] Fixes sleepwalking (#12522) closes https://github.com/space-wizards/space-station-14/issues/12404 --- Content.Server/Bed/Sleep/SleepingSystem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Server/Bed/Sleep/SleepingSystem.cs b/Content.Server/Bed/Sleep/SleepingSystem.cs index 209b135df0..6a94a834ba 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.MobState; using Content.Shared.MobState.Components; +using Content.Shared.Slippery; using Content.Shared.Stunnable; using Content.Shared.Verbs; using Robust.Shared.Audio; @@ -39,6 +40,7 @@ namespace Content.Server.Bed.Sleep SubscribeLocalEvent>(AddWakeVerb); SubscribeLocalEvent(OnInteractHand); SubscribeLocalEvent(OnExamined); + SubscribeLocalEvent(OnSlip); SubscribeLocalEvent(OnInit); } @@ -157,6 +159,12 @@ namespace Content.Server.Bed.Sleep args.PushMarkup(Loc.GetString("sleep-examined", ("target", Identity.Entity(uid, EntityManager)))); } } + + private void OnSlip(EntityUid uid, SleepingComponent component, SlipAttemptEvent args) + { + args.Cancel(); + } + private void OnInit(EntityUid uid, ForcedSleepingComponent component, ComponentInit args) { TrySleeping(uid);