ActionBlocker CanEquip uses EntityUid exclusively
This commit is contained in:
@@ -207,7 +207,7 @@ namespace Content.Server.Inventory.Components
|
||||
var pass = false;
|
||||
reason = null;
|
||||
|
||||
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(Owner))
|
||||
if (mobCheck && !EntitySystem.Get<ActionBlockerSystem>().CanEquip(OwnerUid))
|
||||
{
|
||||
reason = Loc.GetString("inventory-component-can-equip-cannot");
|
||||
return false;
|
||||
|
||||
@@ -99,18 +99,12 @@ namespace Content.Shared.ActionBlocker
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanEquip(IEntity entity)
|
||||
{
|
||||
var ev = new EquipAttemptEvent(entity);
|
||||
|
||||
RaiseLocalEvent(entity.Uid, ev);
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanEquip(EntityUid uid)
|
||||
{
|
||||
return CanEquip(EntityManager.GetEntity(uid));
|
||||
var ev = new EquipAttemptEvent(uid);
|
||||
RaiseLocalEvent(uid, ev);
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanUnequip(IEntity entity)
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace Content.Shared.Inventory.Events
|
||||
{
|
||||
public class EquipAttemptEvent : CancellableEntityEventArgs
|
||||
{
|
||||
public EquipAttemptEvent(IEntity entity)
|
||||
public EquipAttemptEvent(EntityUid uid)
|
||||
{
|
||||
Entity = entity;
|
||||
Uid = uid;
|
||||
}
|
||||
|
||||
public IEntity Entity { get; }
|
||||
public EntityUid Uid { get; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user