fix: Simplifies fastwalk detection (#907)

* Uses a circular buffer for steps.
* Limits to 3 steps instead of 4.
* Gives a 5% buffer on the first step.
This commit is contained in:
Kamron Batman 2022-02-27 02:20:03 -08:00 • committed by GitHub
parent 5b7b99e0de
commit e873d2ed7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 186 additions and 78 deletions

View file

@ -19,16 +19,16 @@ namespace Server.Movement
{
// Movement implementation algorithm
public static IMovementImpl Impl { get; set; }
public static int WalkFootDelay { get; set; } = 440;
public static int RunFootDelay { get; set; } = 220;
public static int WalkMountDelay { get; set; } = 220;
public static int RunMountDelay { get; set; } = 110;
public static int WalkFootDelay { get; set; } = 400;
public static int RunFootDelay { get; set; } = 200;
public static int WalkMountDelay { get; set; } = 200;
public static int RunMountDelay { get; set; } = 100;
public static bool EnableFastwalkPrevention { get; set; } = true;
public static AccessLevel FastwalkExemptionLevel { get; set; } = AccessLevel.Counselor;
// If this is changed during runtime, then the steps array needs resizing.
public static int MaxSteps { get; private set; } = 4;
public static int MaxSteps { get; private set; } = 3;
public static void Configure()
{