Turn interaction related attempt events into structs (#29168)
* Turn InteractionAttemptEvent into a struct event * readonly * GettingInteractedWithAttemptEvent * ConsciousAttemptEvent
This commit is contained in:
@@ -70,7 +70,7 @@ namespace Content.Shared.ActionBlocker
|
||||
return false;
|
||||
|
||||
var ev = new InteractionAttemptEvent(user, target);
|
||||
RaiseLocalEvent(user, ev);
|
||||
RaiseLocalEvent(user, ref ev);
|
||||
|
||||
if (ev.Cancelled)
|
||||
return false;
|
||||
@@ -79,7 +79,7 @@ namespace Content.Shared.ActionBlocker
|
||||
return true;
|
||||
|
||||
var targetEv = new GettingInteractedWithAttemptEvent(user, target);
|
||||
RaiseLocalEvent(target.Value, targetEv);
|
||||
RaiseLocalEvent(target.Value, ref targetEv);
|
||||
|
||||
return !targetEv.Cancelled;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace Content.Shared.ActionBlocker
|
||||
public bool CanConsciouslyPerformAction(EntityUid user)
|
||||
{
|
||||
var ev = new ConsciousAttemptEvent(user);
|
||||
RaiseLocalEvent(user, ev);
|
||||
RaiseLocalEvent(user, ref ev);
|
||||
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user