diff --git a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs index c649746a53..f9c9858ec8 100644 --- a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs +++ b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs @@ -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) diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index cf7514a8d6..f4921dfd0b 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -543,7 +543,7 @@ namespace Content.Shared.Interaction /// 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; diff --git a/Content.Shared/Throwing/ThrowAttemptEvent.cs b/Content.Shared/Throwing/ThrowAttemptEvent.cs index ba17ab4789..9c23647c69 100644 --- a/Content.Shared/Throwing/ThrowAttemptEvent.cs +++ b/Content.Shared/Throwing/ThrowAttemptEvent.cs @@ -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; } } ///