Turn interaction related attempt events into structs (#29168)
* Turn InteractionAttemptEvent into a struct event * readonly * GettingInteractedWithAttemptEvent * ConsciousAttemptEvent
This commit is contained in:
@@ -19,12 +19,18 @@ namespace Content.Shared.Ghost
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<GhostComponent, UseAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<GhostComponent, InteractionAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<GhostComponent, InteractionAttemptEvent>(OnAttemptInteract);
|
||||
SubscribeLocalEvent<GhostComponent, EmoteAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<GhostComponent, DropAttemptEvent>(OnAttempt);
|
||||
SubscribeLocalEvent<GhostComponent, PickupAttemptEvent>(OnAttempt);
|
||||
}
|
||||
|
||||
private void OnAttemptInteract(Entity<GhostComponent> ent, ref InteractionAttemptEvent args)
|
||||
{
|
||||
if (!ent.Comp.CanGhostInteract)
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnAttempt(EntityUid uid, GhostComponent component, CancellableEntityEventArgs args)
|
||||
{
|
||||
if (!component.CanGhostInteract)
|
||||
|
||||
Reference in New Issue
Block a user