Prevent shoe buffs while crawling (#39648)

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs
2025-11-23 15:22:28 -06:00
committed by Vanessa
co-authored by Princess Cheeseballs
parent f998ea7160
commit 96f9e1fe2d
8 changed files with 81 additions and 24 deletions
@@ -25,6 +25,7 @@ using Content.Shared.Overlays;
using Content.Shared.Projectiles;
using Content.Shared.Radio;
using Content.Shared.Slippery;
using Content.Shared.Standing;
using Content.Shared.Strip.Components;
using Content.Shared.Temperature;
using Content.Shared.Verbs;
@@ -58,6 +59,8 @@ public partial class InventorySystem
SubscribeLocalEvent<InventoryComponent, IsUnequippingTargetAttemptEvent>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, ChameleonControllerOutfitSelectedEvent>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, BeforeEmoteEvent>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, StoodEvent>(RelayInventoryEvent);
SubscribeLocalEvent<InventoryComponent, DownedEvent>(RelayInventoryEvent);
// by-ref events
SubscribeLocalEvent<InventoryComponent, RefreshFrictionModifiersEvent>(RefRelayInventoryEvent);
@@ -116,7 +119,7 @@ public partial class InventorySystem
return;
// this copies the by-ref event if it is a struct
var ev = new InventoryRelayedEvent<T>(args);
var ev = new InventoryRelayedEvent<T>(args, inventory.Owner);
var enumerator = new InventorySlotEnumerator(inventory, args.TargetSlots);
while (enumerator.NextItem(out var item))
{
@@ -132,7 +135,7 @@ public partial class InventorySystem
if (args.TargetSlots == SlotFlags.NONE)
return;
var ev = new InventoryRelayedEvent<T>(args);
var ev = new InventoryRelayedEvent<T>(args, inventory.Owner);
var enumerator = new InventorySlotEnumerator(inventory, args.TargetSlots);
while (enumerator.NextItem(out var item))
{
@@ -143,7 +146,7 @@ public partial class InventorySystem
private void OnGetEquipmentVerbs(EntityUid uid, InventoryComponent component, GetVerbsEvent<EquipmentVerb> args)
{
// Automatically relay stripping related verbs to all equipped clothing.
var ev = new InventoryRelayedEvent<GetVerbsEvent<EquipmentVerb>>(args);
var ev = new InventoryRelayedEvent<GetVerbsEvent<EquipmentVerb>>(args, uid);
var enumerator = new InventorySlotEnumerator(component);
while (enumerator.NextItem(out var item, out var slotDef))
{
@@ -155,7 +158,7 @@ public partial class InventorySystem
private void OnGetInnateVerbs(EntityUid uid, InventoryComponent component, GetVerbsEvent<InnateVerb> args)
{
// Automatically relay stripping related verbs to all equipped clothing.
var ev = new InventoryRelayedEvent<GetVerbsEvent<InnateVerb>>(args);
var ev = new InventoryRelayedEvent<GetVerbsEvent<InnateVerb>>(args, uid);
var enumerator = new InventorySlotEnumerator(component, SlotFlags.WITHOUT_POCKET);
while (enumerator.NextItem(out var item))
{
@@ -178,9 +181,12 @@ public sealed class InventoryRelayedEvent<TEvent> : EntityEventArgs
{
public TEvent Args;
public InventoryRelayedEvent(TEvent args)
public EntityUid Owner;
public InventoryRelayedEvent(TEvent args, EntityUid owner)
{
Args = args;
Owner = owner;
}
}