From c4016b97c5f4df1877ff63246a67a99af44a717c Mon Sep 17 00:00:00 2001 From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:35:31 +0200 Subject: [PATCH] fix DoAfter DistanceThreshold (#39276) --- Content.Shared/DoAfter/DoAfterArgs.cs | 2 +- Content.Shared/DoAfter/SharedDoAfterSystem.Update.cs | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Content.Shared/DoAfter/DoAfterArgs.cs b/Content.Shared/DoAfter/DoAfterArgs.cs index ac66278538..ba2b38ab5d 100644 --- a/Content.Shared/DoAfter/DoAfterArgs.cs +++ b/Content.Shared/DoAfter/DoAfterArgs.cs @@ -122,7 +122,7 @@ public sealed partial class DoAfterArgs /// Threshold for distance user from the used OR target entities. /// [DataField] - public float? DistanceThreshold; + public float? DistanceThreshold = 1.5f; /// /// Whether damage will cancel the DoAfter. See also . diff --git a/Content.Shared/DoAfter/SharedDoAfterSystem.Update.cs b/Content.Shared/DoAfter/SharedDoAfterSystem.Update.cs index f6eb9ef996..31ff034809 100644 --- a/Content.Shared/DoAfter/SharedDoAfterSystem.Update.cs +++ b/Content.Shared/DoAfter/SharedDoAfterSystem.Update.cs @@ -192,11 +192,6 @@ public abstract partial class SharedDoAfterSystem : EntitySystem if (!_interaction.InRangeUnobstructed(args.User, args.Target.Value, args.DistanceThreshold.Value)) return true; } - else - { - if (!_interaction.InRangeUnobstructed(args.User, args.Target.Value)) - return true; - } } // Whether the distance between the tool and the user has grown too much. @@ -209,11 +204,6 @@ public abstract partial class SharedDoAfterSystem : EntitySystem args.DistanceThreshold.Value)) return true; } - else - { - if (!_interaction.InRangeUnobstructed(args.User,args.Used.Value)) - return true; - } } if (args.AttemptFrequency == AttemptFrequency.EveryTick && !TryAttemptEvent(doAfter))