Keep autorun sprinting through the final tiles.
Drop the last-3-tiles walk switch so destination approaches stay at run gait until arrival.
@@ -118,7 +118,6 @@ let leftClickConsumed = false;
118
118
/** Mob/NPC entity ids recently trading blows with the local player (LMB prefers Attack). */
119
119
const combatWithLocalIds = new Set();
120
120
121
const AUTORUN_DISTANCE_TILES = 3;
122
121
const AUTORUN_STAMINA_RESUME_RATIO = 0.5;
123
122
124
123
function noteCombatWithLocal (attackerId, targetId)
@@ -264,7 +263,7 @@ function syncAutorun ()
264
263
return;
265
264
}
266
265
const dist = chebyshev(local.tileX, local.tileY, dest.tileX, dest.tileY);
267
const wantRun = dist > AUTORUN_DISTANCE_TILES;
266
const wantRun = dist > 0;
268
267
const current = staminaUi?.getCurrent?.() ?? 0;
269
268
const max = Math.max(1, staminaUi?.getMax?.() ?? 1);
270
269
if (gait === GAIT.run && current <= 0)
@@ -118,7 +118,6 @@ let leftClickConsumed = false;118
/** Mob/NPC entity ids recently trading blows with the local player (LMB prefers Attack). */118
/** Mob/NPC entity ids recently trading blows with the local player (LMB prefers Attack). */119
const combatWithLocalIds = new Set();119
const combatWithLocalIds = new Set();120
120
121
const AUTORUN_DISTANCE_TILES = 3;122
const AUTORUN_STAMINA_RESUME_RATIO = 0.5;121
const AUTORUN_STAMINA_RESUME_RATIO = 0.5;123
122
124
function noteCombatWithLocal (attackerId, targetId)123
function noteCombatWithLocal (attackerId, targetId)@@ -264,7 +263,7 @@ function syncAutorun ()264
return;263
return;265
}264
}266
const dist = chebyshev(local.tileX, local.tileY, dest.tileX, dest.tileY);265
const dist = chebyshev(local.tileX, local.tileY, dest.tileX, dest.tileY);267
const wantRun = dist > AUTORUN_DISTANCE_TILES;266
const wantRun = dist > 0;268
const current = staminaUi?.getCurrent?.() ?? 0;267
const current = staminaUi?.getCurrent?.() ?? 0;269
const max = Math.max(1, staminaUi?.getMax?.() ?? 1);268
const max = Math.max(1, staminaUi?.getMax?.() ?? 1);270
if (gait === GAIT.run && current <= 0)269
if (gait === GAIT.run && current <= 0)