Fix unintentional inventory relayed event handling (#10934)

* Add InventoryRelayedEvent<TEvent>

* implement relays

* typos

* a
This commit is contained in:
Leon Friedrich
2022-10-24 21:04:49 +13:00
committed by GitHub
parent 0b8622e9e7
commit 145471be2d
9 changed files with 53 additions and 15 deletions

View File

@@ -30,6 +30,8 @@ namespace Content.Shared.Slippery
SubscribeLocalEvent<SlipperyComponent, StepTriggerAttemptEvent>(HandleAttemptCollide);
SubscribeLocalEvent<SlipperyComponent, StepTriggeredEvent>(HandleStepTrigger);
SubscribeLocalEvent<NoSlipComponent, SlipAttemptEvent>(OnNoSlipAttempt);
// as long as slip-resistant mice are never added, this should be fine (otherwise a mouse-hat will transfer it's power to the wearer).
SubscribeLocalEvent<NoSlipComponent, InventoryRelayedEvent<SlipAttemptEvent>>((e, c, ev) => OnNoSlipAttempt(e, c, ev.Args));
SubscribeLocalEvent<SlipperyComponent, ComponentGetState>(OnSlipperyGetState);
SubscribeLocalEvent<SlipperyComponent, ComponentHandleState>(OnSlipperyHandleState);
}