diff --git a/Content.Server/Inventory/Components/InventoryComponent.cs b/Content.Server/Inventory/Components/InventoryComponent.cs index 8f62ae13a5..22b40ba08c 100644 --- a/Content.Server/Inventory/Components/InventoryComponent.cs +++ b/Content.Server/Inventory/Components/InventoryComponent.cs @@ -330,7 +330,7 @@ namespace Content.Server.Inventory.Components /// public bool CanUnequip(Slots slot, bool mobCheck = true) { - if (mobCheck && !EntitySystem.Get().CanUnequip(Owner)) + if (mobCheck && !EntitySystem.Get().CanUnequip(OwnerUid)) return false; var inventorySlot = _slotContainers[slot]; diff --git a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs index e877b17e1d..30b8c10f7b 100644 --- a/Content.Shared/ActionBlocker/ActionBlockerSystem.cs +++ b/Content.Shared/ActionBlocker/ActionBlockerSystem.cs @@ -107,18 +107,12 @@ namespace Content.Shared.ActionBlocker return !ev.Cancelled; } - public bool CanUnequip(IEntity entity) - { - var ev = new UnequipAttemptEvent(entity); - - RaiseLocalEvent(entity.Uid, ev); - - return !ev.Cancelled; - } - public bool CanUnequip(EntityUid uid) { - return CanUnequip(EntityManager.GetEntity(uid)); + var ev = new UnequipAttemptEvent(uid); + RaiseLocalEvent(uid, ev); + + return !ev.Cancelled; } public bool CanChangeDirection(IEntity entity) diff --git a/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs b/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs index 3e1592e75e..05cd32a4dc 100644 --- a/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs +++ b/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs @@ -4,11 +4,11 @@ namespace Content.Shared.Inventory.Events { public class UnequipAttemptEvent : CancellableEntityEventArgs { - public UnequipAttemptEvent(IEntity entity) + public UnequipAttemptEvent(EntityUid uid) { - Entity = entity; + Uid = uid; } - public IEntity Entity { get; } + public EntityUid Uid { get; } } }