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-08-20 04:08:31 -07:00
committed by GitHub
parent 95b0df9a89
commit 47dd036ef2
8 changed files with 80 additions and 27 deletions

View File

@@ -24,6 +24,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;
@@ -57,6 +58,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);
@@ -114,7 +117,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))
{
@@ -130,7 +133,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))
{
@@ -141,7 +144,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))
{
@@ -153,7 +156,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))
{
@@ -176,9 +179,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;
}
}