Add BreakOnDistance to DoAfterEventArgs (#8902)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -20,6 +20,11 @@ namespace Content.Server.DoAfter
|
||||
/// </summary>
|
||||
public EntityUid? Target { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Entity used by the User on the Target.
|
||||
/// </summary>
|
||||
public EntityUid? Used { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Manually cancel the do_after so it no longer runs
|
||||
/// </summary>
|
||||
@@ -55,6 +60,11 @@ namespace Content.Server.DoAfter
|
||||
public FixedPoint2 DamageThreshold { get; set; }
|
||||
public bool BreakOnStun { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Threshold for distance user from the used OR target entities.
|
||||
/// </summary>
|
||||
public float? DistanceThreshold { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Requires a function call once at the end (like InRangeUnobstructed).
|
||||
/// </summary>
|
||||
@@ -102,12 +112,14 @@ namespace Content.Server.DoAfter
|
||||
EntityUid user,
|
||||
float delay,
|
||||
CancellationToken cancelToken = default,
|
||||
EntityUid? target = null)
|
||||
EntityUid? target = null,
|
||||
EntityUid? used = null)
|
||||
{
|
||||
User = user;
|
||||
Delay = delay;
|
||||
CancelToken = cancelToken;
|
||||
Target = target;
|
||||
Used = used;
|
||||
MovementThreshold = 0.1f;
|
||||
DamageThreshold = 1.0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user