Add more info to GettingAttackedAttemptEvent (#28548)
This commit is contained in:
@@ -1,13 +1,9 @@
|
|||||||
using Content.Shared.Bed.Sleep;
|
|
||||||
using Content.Shared.Body.Events;
|
using Content.Shared.Body.Events;
|
||||||
using Content.Shared.DragDrop;
|
|
||||||
using Content.Shared.Emoting;
|
using Content.Shared.Emoting;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
using Content.Shared.Item;
|
using Content.Shared.Item;
|
||||||
using Content.Shared.Mobs;
|
|
||||||
using Content.Shared.Mobs.Components;
|
|
||||||
using Content.Shared.Movement.Components;
|
using Content.Shared.Movement.Components;
|
||||||
using Content.Shared.Movement.Events;
|
using Content.Shared.Movement.Events;
|
||||||
using Content.Shared.Speech;
|
using Content.Shared.Speech;
|
||||||
@@ -194,7 +190,7 @@ namespace Content.Shared.ActionBlocker
|
|||||||
if (target == null)
|
if (target == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
var tev = new GettingAttackedAttemptEvent();
|
var tev = new GettingAttackedAttemptEvent(uid, weapon, disarm);
|
||||||
RaiseLocalEvent(target.Value, ref tev);
|
RaiseLocalEvent(target.Value, ref tev);
|
||||||
return !tev.Cancelled;
|
return !tev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,4 +4,4 @@ namespace Content.Shared.Interaction.Events;
|
|||||||
/// Raised directed on the target entity when being attacked.
|
/// Raised directed on the target entity when being attacked.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ByRefEvent]
|
[ByRefEvent]
|
||||||
public record struct GettingAttackedAttemptEvent(bool Cancelled);
|
public record struct GettingAttackedAttemptEvent(EntityUid Attacker, EntityUid? Weapon, bool Disarm, bool Cancelled = false);
|
||||||
|
|||||||
Reference in New Issue
Block a user