diff --git a/Content.Server/Chat/Managers/ChatManager.cs b/Content.Server/Chat/Managers/ChatManager.cs index 1e297cfca8..59953a32b3 100644 --- a/Content.Server/Chat/Managers/ChatManager.cs +++ b/Content.Server/Chat/Managers/ChatManager.cs @@ -195,7 +195,7 @@ namespace Content.Server.Chat.Managers public void EntityMe(IEntity source, string action) { - if (!EntitySystem.Get().CanEmote(source)) + if (!EntitySystem.Get().CanEmote(source.Uid)) { return; } diff --git a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs index 7e5ebd459c..d2fd79f03e 100644 --- a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs +++ b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs @@ -89,18 +89,12 @@ namespace Content.Shared.ActionBlocker return CanPickup(EntityManager.GetEntity(uid)); } - public bool CanEmote(IEntity entity) - { - var ev = new EmoteAttemptEvent(entity); - - RaiseLocalEvent(entity.Uid, ev); - - return !ev.Cancelled; - } - public bool CanEmote(EntityUid uid) { - return CanEmote(EntityManager.GetEntity(uid)); + var ev = new EmoteAttemptEvent(uid); + RaiseLocalEvent(uid, ev); + + return !ev.Cancelled; } public bool CanAttack(EntityUid uid) diff --git a/Content.Shared/Emoting/EmoteAttemptEvent.cs b/Content.Shared/Emoting/EmoteAttemptEvent.cs index d2a749dee6..bc619a1ac3 100644 --- a/Content.Shared/Emoting/EmoteAttemptEvent.cs +++ b/Content.Shared/Emoting/EmoteAttemptEvent.cs @@ -4,11 +4,11 @@ namespace Content.Shared.Emoting { public class EmoteAttemptEvent : CancellableEntityEventArgs { - public EmoteAttemptEvent(IEntity entity) + public EmoteAttemptEvent(EntityUid uid) { - Entity = entity; + Uid = uid; } - public IEntity Entity { get; } + public EntityUid Uid { get; } } }