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>
This commit is contained in:
@@ -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<ForcedSleepingComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<SleepingComponent, UnbuckleAttemptEvent>(OnUnbuckleAttempt);
|
||||
SubscribeLocalEvent<SleepingComponent, EmoteAttemptEvent>(OnEmoteAttempt);
|
||||
}
|
||||
|
||||
private void OnUnbuckleAttempt(Entity<SleepingComponent> ent, ref UnbuckleAttemptEvent args)
|
||||
@@ -310,6 +312,14 @@ public sealed partial class SleepingSystem : EntitySystem
|
||||
Wake((ent, ent.Comp));
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prevents the use of emote actions while sleeping
|
||||
/// </summary>
|
||||
public void OnEmoteAttempt(Entity<SleepingComponent> ent, ref EmoteAttemptEvent args)
|
||||
{
|
||||
args.Cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user