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

@@ -24,7 +24,7 @@ public abstract class SharedMagbootsSystem : EntitySystem
base.Initialize();
SubscribeLocalEvent<MagbootsComponent, GetVerbsEvent<ActivationVerb>>(AddToggleVerb);
SubscribeLocalEvent<MagbootsComponent, SlipAttemptEvent>(OnSlipAttempt);
SubscribeLocalEvent<MagbootsComponent, InventoryRelayedEvent<SlipAttemptEvent>>(OnSlipAttempt);
SubscribeLocalEvent<MagbootsComponent, GetItemActionsEvent>(OnGetActions);
SubscribeLocalEvent<MagbootsComponent, ToggleActionEvent>(OnToggleAction);
}
@@ -72,10 +72,10 @@ public abstract class SharedMagbootsSystem : EntitySystem
args.Verbs.Add(verb);
}
private void OnSlipAttempt(EntityUid uid, MagbootsComponent component, SlipAttemptEvent args)
private void OnSlipAttempt(EntityUid uid, MagbootsComponent component, InventoryRelayedEvent<SlipAttemptEvent> args)
{
if (component.On)
args.Cancel();
args.Args.Cancel();
}
private void OnGetActions(EntityUid uid, MagbootsComponent component, GetItemActionsEvent args)