Added threshold to DoAfter's user and target movement checks (#2585)

* Added threshold to DoAfter user and target movement checks

* Fixed spacing

* Update Content.Server/GameObjects/EntitySystems/DoAfter/DoAfterEventArgs.cs

Co-authored-by: Manel Navola <ManelNavola@users.noreply.github.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Manel Navola
2020-11-22 03:58:31 +01:00
committed by GitHub
parent 86c2e989e6
commit 8c81e7c767
5 changed files with 21 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Threading;
using Content.Shared.Physics;
@@ -60,6 +60,11 @@ namespace Content.Server.GameObjects.EntitySystems.DoAfter
/// </summary>
public bool BreakOnTargetMove { get; set; }
/// <summary>
/// Threshold for user and target movement
/// </summary>
public float MovementThreshold { get; set; }
public bool BreakOnDamage { get; set; }
public bool BreakOnStun { get; set; }
@@ -86,6 +91,7 @@ namespace Content.Server.GameObjects.EntitySystems.DoAfter
Delay = delay;
CancelToken = cancelToken;
Target = target;
MovementThreshold = 0.1f;
if (Target == null)
{