WASD: direction movement steers the walk path directly

The keys rewrite the hero's path every cCreature::Update: one segment
along the held direction, the facing set to it, sliding along blocked
cells. Starting from idle runs the game's own Think steps at once
(StartPendingWalk, WalkAction) instead of waiting up to 110 ms, so
weapon switches no longer stop the walk. Stops wait 50 ms after the
keys are released, and a stop in progress is taken back when keys are
held again. Names for movement, stats and text-key functions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-18 03:18:51 +02:00
1 parent d296e2850b
commit 84c50d8c33
6 files changed
+422 -104

No files matched your search

-13
View File
@@ -36,7 +36,6 @@
#include "game/engine/objects.h"
#include "game/ui/text.h"
#include "mods/skillslots.h"
#include "mods/wasd.h"
#include "re/hook.h"
#include "re/log.h"
#include "re/patch.h"
@@ -308,18 +307,6 @@ void __fastcall UiTaskbar_SelectSkillSlot(void* self, void* edx, uint32_t slot,
}
}
// cUI_Taskbar2::SelectWeaponSet (0x6e1440, ret 8): sends the hero the
// weapon set order (0x114) and, when the weapon class changed, resets its
// animation state (0x54e540), which drops a walk for a tick (measured
// 2026-10-18: action walk -> idle -> walk on switches between melee and bow
// sets, none between melee sets). A WASD walk goes on at once.
void __fastcall UiTaskbar_SelectWeaponSet(void* self, void* edx, uint32_t set, int notify);
RE_HOOK(0x006e1440, UiTaskbar_SelectWeaponSet);
void __fastcall UiTaskbar_SelectWeaponSet(void* self, void* edx, uint32_t set, int notify) {
UiTaskbar_SelectWeaponSet_original(self, edx, set, notify);
mods::wasd::ResumeWalk();
}
// cUI_Taskbar2::RenderArtSlots (0x6e31e0): then the cooldown labels.
void __fastcall UiTaskbar_RenderArtSlots(void* self, void* edx, void* renderer);
RE_HOOK(0x006e31e0, UiTaskbar_RenderArtSlots);