From: DrSmugleaf Date: Sat, 7 Oct 2023 19:11:02 +0000 (-0700) Subject: Fix sleeping action not working (#20813) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e4c4d9b0a4053d5dad734d128862471fd66f71e0;p=space-station-14.git Fix sleeping action not working (#20813) --- diff --git a/Content.Server/Bed/Sleep/SleepingSystem.cs b/Content.Server/Bed/Sleep/SleepingSystem.cs index 30e3a99eea..17fe4d5eff 100644 --- a/Content.Server/Bed/Sleep/SleepingSystem.cs +++ b/Content.Server/Bed/Sleep/SleepingSystem.cs @@ -1,6 +1,6 @@ -using Content.Server.Actions; using Content.Server.Popups; using Content.Server.Sound.Components; +using Content.Shared.Actions; using Content.Shared.Audio; using Content.Shared.Bed.Sleep; using Content.Shared.Damage; @@ -36,6 +36,7 @@ namespace Content.Server.Bed.Sleep SubscribeLocalEvent(OnSleepStateChanged); SubscribeLocalEvent(OnDamageChanged); SubscribeLocalEvent(OnSleepAction); + SubscribeLocalEvent(OnBedSleepAction); SubscribeLocalEvent(OnWakeAction); SubscribeLocalEvent(OnMobStateChanged); SubscribeLocalEvent>(AddWakeVerb); @@ -93,6 +94,11 @@ namespace Content.Server.Bed.Sleep TrySleeping(uid); } + private void OnBedSleepAction(EntityUid uid, ActionsContainerComponent component, SleepActionEvent args) + { + TrySleeping(args.Performer); + } + private void OnWakeAction(EntityUid uid, MobStateComponent component, WakeActionEvent args) { if (!TryWakeCooldown(uid))