ActionBlocker CanChangeDirection uses EntityUid exclusively
This commit is contained in:
@@ -115,18 +115,12 @@ namespace Content.Shared.ActionBlocker
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanChangeDirection(IEntity entity)
|
||||
{
|
||||
var ev = new ChangeDirectionAttemptEvent(entity);
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanChangeDirection(EntityUid uid)
|
||||
{
|
||||
return CanChangeDirection(EntityManager.GetEntity(uid));
|
||||
var ev = new ChangeDirectionAttemptEvent(uid);
|
||||
RaiseLocalEvent(uid, ev);
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanShiver(IEntity entity)
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace Content.Shared.Interaction.Events
|
||||
{
|
||||
public class ChangeDirectionAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public ChangeDirectionAttemptEvent(IEntity entity)
|
||||
public ChangeDirectionAttemptEvent(EntityUid uid)
|
||||
{
|
||||
Entity = entity;
|
||||
Uid = uid;
|
||||
}
|
||||
|
||||
public IEntity Entity { get; }
|
||||
public EntityUid Uid { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Content.Shared.Interaction
|
||||
|
||||
public bool TryFaceAngle(IEntity user, Angle diffAngle)
|
||||
{
|
||||
if (_actionBlockerSystem.CanChangeDirection(user))
|
||||
if (_actionBlockerSystem.CanChangeDirection(user.Uid))
|
||||
{
|
||||
user.Transform.WorldRotation = diffAngle;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user