fix DoAfter DistanceThreshold (#39276)
This commit is contained in:
@@ -122,7 +122,7 @@ public sealed partial class DoAfterArgs
|
|||||||
/// Threshold for distance user from the used OR target entities.
|
/// Threshold for distance user from the used OR target entities.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField]
|
||||||
public float? DistanceThreshold;
|
public float? DistanceThreshold = 1.5f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether damage will cancel the DoAfter. See also <see cref="DamageThreshold"/>.
|
/// Whether damage will cancel the DoAfter. See also <see cref="DamageThreshold"/>.
|
||||||
|
|||||||
@@ -192,11 +192,6 @@ public abstract partial class SharedDoAfterSystem : EntitySystem
|
|||||||
if (!_interaction.InRangeUnobstructed(args.User, args.Target.Value, args.DistanceThreshold.Value))
|
if (!_interaction.InRangeUnobstructed(args.User, args.Target.Value, args.DistanceThreshold.Value))
|
||||||
return true;
|
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.
|
// 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))
|
args.DistanceThreshold.Value))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (!_interaction.InRangeUnobstructed(args.User,args.Used.Value))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.AttemptFrequency == AttemptFrequency.EveryTick && !TryAttemptEvent(doAfter))
|
if (args.AttemptFrequency == AttemptFrequency.EveryTick && !TryAttemptEvent(doAfter))
|
||||||
|
|||||||
Reference in New Issue
Block a user