ActionBlocker CanEmote uses EntityUid exclusively
This commit is contained in:
@@ -195,7 +195,7 @@ namespace Content.Server.Chat.Managers
|
||||
|
||||
public void EntityMe(IEntity source, string action)
|
||||
{
|
||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanEmote(source))
|
||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanEmote(source.Uid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user