ActionBlocker CanThrow uses EntityUid exclusively
This commit is contained in:
parent
c051b1e056
commit
c68c3219f8
|
|
@ -51,18 +51,13 @@ namespace Content.Shared.ActionBlocker
|
|||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanThrow(IEntity entity)
|
||||
{
|
||||
var ev = new ThrowAttemptEvent(entity);
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanThrow(EntityUid uid)
|
||||
{
|
||||
return CanThrow(EntityManager.GetEntity(uid));
|
||||
var ev = new ThrowAttemptEvent(uid);
|
||||
|
||||
RaiseLocalEvent(uid, ev);
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanSpeak(IEntity entity)
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ namespace Content.Shared.Interaction
|
|||
/// </summary>
|
||||
public bool TryThrowInteraction(IEntity user, IEntity item)
|
||||
{
|
||||
if (user == null || item == null || !_actionBlockerSystem.CanThrow(user)) return false;
|
||||
if (user == null || item == null || !_actionBlockerSystem.CanThrow(user.Uid)) return false;
|
||||
|
||||
ThrownInteraction(user, item);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ namespace Content.Shared.Throwing
|
|||
{
|
||||
public class ThrowAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public ThrowAttemptEvent(IEntity entity)
|
||||
public ThrowAttemptEvent(EntityUid uid)
|
||||
{
|
||||
Entity = entity;
|
||||
Uid = uid;
|
||||
}
|
||||
|
||||
public IEntity Entity { get; }
|
||||
public EntityUid Uid { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue