BlueGit

timfa questward

Keep autorun sprinting through the final tiles.

Drop the last-3-tiles walk switch so destination approaches stay at run gait until arrival.

timfa Tim Falken · pushed by timfa

Authored 2026-09-06 · 2 months ago

Hash
cd5aeb4f66137723aa3bf26f1b331ba7d7135b62
Parent
7b7eb784
1 file changed +1 −2
client/src/play/main.js +1 −2
@@ -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). */
119const combatWithLocalIds = new Set();
119const combatWithLocalIds = new Set();
120
120
121const AUTORUN_DISTANCE_TILES = 3;
122const AUTORUN_STAMINA_RESUME_RATIO = 0.5;
121const AUTORUN_STAMINA_RESUME_RATIO = 0.5;
123
122
124function noteCombatWithLocal (attackerId, targetId)
123function 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)