Hi!
I have a recurring issue where restarting my <program> fails to read player keybindings past the first 6 or so pointers.
Calling /reload in game and restarting the <program>, all keybindings get enumerated again.
Anyone else encountered such issues? Did you fix it by re-reading player keybindings off of some different address, or perhaps only reading them once on program startup?
Digging around a bit I found that there's two potentially applicable structs & loops. Added the second as a fallback, we'll see how that goes.
Code:
struct Keybind {
next: Keybind, // 0x18
bind: UTF8Pointer, // 0x30
action: UTF8Pointer, // 0x40
}
fn read_bindings () {
let base = wow.base + keybindings.base;
let mut ptr = read_ptr(base + 0x50);
while ptr != null {
// ...
ptr = read_ptr(ptr.next);
}
}
Code:
struct Keybind {
next: Keybind, // 0x0,
bind: UTF8Pointer, // 0x20
action: UTF8Pointer // 0x30
}
fn read_bindings_fallback() {
let base = wow.base + keybindings.base;
let mut ptr = read_ptr(base + 0x48);
while ptr != null {
// ...
ptr = read_ptr(ptr.next);
}
}
The pointer chain at keybinding.base + 0x48 appears to be the same list of keybindings but in reverse, at a glance.