diff --git a/Content.Server/Strip/StrippableComponent.cs b/Content.Server/Strip/StrippableComponent.cs index ad5c423c8a..9ccc8f50f2 100644 --- a/Content.Server/Strip/StrippableComponent.cs +++ b/Content.Server/Strip/StrippableComponent.cs @@ -116,7 +116,7 @@ namespace Content.Server.Strip return false; } - if (!invSystem.CanEquip(Owner, item.Owner, slot, out _)) + if (!invSystem.CanEquip(user, Owner, item.Owner, slot, out _)) { user.PopupMessageCursor(Loc.GetString("strippable-component-cannot-equip-message",("owner", Owner))); return false; @@ -141,7 +141,7 @@ namespace Content.Server.Strip if (result != DoAfterStatus.Finished) return; userHands.Drop(item!.Owner, false); - invSystem.TryEquip(Owner, item.Owner, slot); + invSystem.TryEquip(user, Owner, item.Owner, slot); UpdateState(); } @@ -258,7 +258,7 @@ namespace Content.Server.Strip var result = await doAfterSystem.WaitDoAfter(doAfterArgs); if (result != DoAfterStatus.Finished) return; - if (invSystem.TryGetSlotEntity(Owner, slot, out var item) && invSystem.TryUnequip(Owner, slot)) + if (invSystem.TryGetSlotEntity(Owner, slot, out var item) && invSystem.TryUnequip(user, Owner, slot)) { userHands.PutInHandOrDrop(item.Value); } diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 61c6846e98..f7b88578dd 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -63,12 +63,16 @@ namespace Content.Shared.Cuffs private void OnEquipAttempt(EntityUid uid, SharedCuffableComponent component, IsEquippingAttemptEvent args) { - CheckAct(uid, component, args); + // is this a self-equip, or are they being stripped? + if (args.Equipee == uid) + CheckAct(uid, component, args); } private void OnUnequipAttempt(EntityUid uid, SharedCuffableComponent component, IsUnequippingAttemptEvent args) { - CheckAct(uid, component, args); + // is this a self-equip, or are they being stripped? + if (args.Unequipee == uid) + CheckAct(uid, component, args); } private void OnAttackAttempt(EntityUid uid, SharedCuffableComponent component, AttackAttemptEvent args) diff --git a/Content.Shared/Inventory/Events/EquipAttemptEvents.cs b/Content.Shared/Inventory/Events/EquipAttemptEvents.cs index 0c2b4e8062..adbe9e5709 100644 --- a/Content.Shared/Inventory/Events/EquipAttemptEvents.cs +++ b/Content.Shared/Inventory/Events/EquipAttemptEvents.cs @@ -1,11 +1,11 @@ -using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects; namespace Content.Shared.Inventory.Events; public abstract class EquipAttemptBase : CancellableEntityEventArgs { /// - /// The entity equipping. + /// The entity performing the action. NOT necessarily the one actually "receiving" the equipment. /// public readonly EntityUid Equipee; diff --git a/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs b/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs index 5fbe120364..ab0704b09c 100644 --- a/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs +++ b/Content.Shared/Inventory/Events/UnequipAttemptEvent.cs @@ -1,11 +1,11 @@ -using Robust.Shared.GameObjects; +using Robust.Shared.GameObjects; namespace Content.Shared.Inventory.Events; public class UnequipAttemptEventBase : CancellableEntityEventArgs { /// - /// The entity unequipping. + /// The entity performing the action. NOT necessarily the same as the entity whose equipment is being removed.. /// public readonly EntityUid Unequipee; diff --git a/Content.Shared/MobState/EntitySystems/MobStateSystem.cs b/Content.Shared/MobState/EntitySystems/MobStateSystem.cs index d1d8ee05e7..9467cc6535 100644 --- a/Content.Shared/MobState/EntitySystems/MobStateSystem.cs +++ b/Content.Shared/MobState/EntitySystems/MobStateSystem.cs @@ -79,7 +79,9 @@ namespace Content.Shared.MobState.EntitySystems private void OnEquipAttempt(EntityUid uid, MobStateComponent component, IsEquippingAttemptEvent args) { - CheckAct(uid, component, args); + // is this a self-equip, or are they being stripped? + if (args.Equipee == uid) + CheckAct(uid, component, args); } private void OnEmoteAttempt(EntityUid uid, MobStateComponent component, EmoteAttemptEvent args) @@ -89,7 +91,9 @@ namespace Content.Shared.MobState.EntitySystems private void OnUnequipAttempt(EntityUid uid, MobStateComponent component, IsUnequippingAttemptEvent args) { - CheckAct(uid, component, args); + // is this a self-equip, or are they being stripped? + if (args.Unequipee == uid) + CheckAct(uid, component, args); } private void OnAttackAttempt(EntityUid uid, MobStateComponent component, AttackAttemptEvent args) diff --git a/Content.Shared/Stunnable/SharedStunSystem.cs b/Content.Shared/Stunnable/SharedStunSystem.cs index faf5eb7ae4..c69e5c8245 100644 --- a/Content.Shared/Stunnable/SharedStunSystem.cs +++ b/Content.Shared/Stunnable/SharedStunSystem.cs @@ -258,13 +258,15 @@ namespace Content.Shared.Stunnable private void OnEquipAttempt(EntityUid uid, StunnedComponent stunned, IsEquippingAttemptEvent args) { - if(args.Equipee == uid) + // is this a self-equip, or are they being stripped? + if (args.Equipee == uid) args.Cancel(); } private void OnUnequipAttempt(EntityUid uid, StunnedComponent stunned, IsUnequippingAttemptEvent args) { - if(args.Unequipee == uid) + // is this a self-equip, or are they being stripped? + if (args.Unequipee == uid) args.Cancel(); }