ActionBlocker CanEmote uses EntityUid exclusively

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 13:41:24 +01:00
parent d4ded87448
commit b82cb38bf9
3 changed files with 8 additions and 14 deletions

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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; }
}
}