From 8093a49943c621d381b04e54a6790f8b98b5813d Mon Sep 17 00:00:00 2001 From: SkaldetSkaeg Date: Sun, 13 Oct 2024 15:22:05 +0700 Subject: [PATCH] Block emotes for sleeping (#32779) * Block emotes * typing issue * Update Content.Shared/Bed/Sleep/SleepingSystem.cs Co-authored-by: MilenVolf <63782763+MilenVolf@users.noreply.github.com> --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: MilenVolf <63782763+MilenVolf@users.noreply.github.com> --- Content.Shared/Bed/Sleep/SleepingSystem.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Content.Shared/Bed/Sleep/SleepingSystem.cs b/Content.Shared/Bed/Sleep/SleepingSystem.cs index 0e29fcd98a..6a04bfe42d 100644 --- a/Content.Shared/Bed/Sleep/SleepingSystem.cs +++ b/Content.Shared/Bed/Sleep/SleepingSystem.cs @@ -2,6 +2,7 @@ using Content.Shared.Actions; using Content.Shared.Buckle.Components; using Content.Shared.Damage; using Content.Shared.Damage.ForceSay; +using Content.Shared.Emoting; using Content.Shared.Examine; using Content.Shared.Eye.Blinding.Systems; using Content.Shared.IdentityManagement; @@ -61,6 +62,7 @@ public sealed partial class SleepingSystem : EntitySystem SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnUnbuckleAttempt); + SubscribeLocalEvent(OnEmoteAttempt); } private void OnUnbuckleAttempt(Entity ent, ref UnbuckleAttemptEvent args) @@ -310,6 +312,14 @@ public sealed partial class SleepingSystem : EntitySystem Wake((ent, ent.Comp)); return true; } + + /// + /// Prevents the use of emote actions while sleeping + /// + public void OnEmoteAttempt(Entity ent, ref EmoteAttemptEvent args) + { + args.Cancel(); + } }