Turn interaction related attempt events into structs (#29168)
* Turn InteractionAttemptEvent into a struct event * readonly * GettingInteractedWithAttemptEvent * ConsciousAttemptEvent
This commit is contained in:
@@ -79,7 +79,7 @@ namespace Content.Shared.Cuffs
|
||||
SubscribeLocalEvent<CuffableComponent, PickupAttemptEvent>(CheckAct);
|
||||
SubscribeLocalEvent<CuffableComponent, AttackAttemptEvent>(CheckAct);
|
||||
SubscribeLocalEvent<CuffableComponent, UseAttemptEvent>(CheckAct);
|
||||
SubscribeLocalEvent<CuffableComponent, InteractionAttemptEvent>(CheckAct);
|
||||
SubscribeLocalEvent<CuffableComponent, InteractionAttemptEvent>(CheckInteract);
|
||||
|
||||
SubscribeLocalEvent<HandcuffComponent, AfterInteractEvent>(OnCuffAfterInteract);
|
||||
SubscribeLocalEvent<HandcuffComponent, MeleeHitEvent>(OnCuffMeleeHit);
|
||||
@@ -87,6 +87,12 @@ namespace Content.Shared.Cuffs
|
||||
SubscribeLocalEvent<HandcuffComponent, VirtualItemDeletedEvent>(OnCuffVirtualItemDeleted);
|
||||
}
|
||||
|
||||
private void CheckInteract(Entity<CuffableComponent> ent, ref InteractionAttemptEvent args)
|
||||
{
|
||||
if (!ent.Comp.CanStillInteract)
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnUncuffAttempt(ref UncuffAttemptEvent args)
|
||||
{
|
||||
if (args.Cancelled)
|
||||
|
||||
Reference in New Issue
Block a user