]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix DoAfter DistanceThreshold (#39276)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Wed, 6 Aug 2025 14:35:31 +0000 (16:35 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Aug 2025 14:35:31 +0000 (16:35 +0200)
Content.Shared/DoAfter/DoAfterArgs.cs
Content.Shared/DoAfter/SharedDoAfterSystem.Update.cs

index ac66278538587ff7a8d9bb1c9ad7dd3353f960e3..ba2b38ab5d85d751e4d8a6f9b7e80048a63d7b45 100644 (file)
@@ -122,7 +122,7 @@ public sealed partial class DoAfterArgs
     ///     Threshold for distance user from the used OR target entities.
     /// </summary>
     [DataField]
-    public float? DistanceThreshold;
+    public float? DistanceThreshold = 1.5f;
 
     /// <summary>
     ///     Whether damage will cancel the DoAfter. See also <see cref="DamageThreshold"/>.
index f6eb9ef99692908db526516f236b6e9f27c0266a..31ff0348091ff2d4d7e519f3a452f1a452a85a1a 100644 (file)
@@ -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))