Closed Jujstme closed 11 months ago
What's the reason for allowing a higher capacity than the path's actual length?
It's a thing I discussed with Knauth when I was originally writing the function for Unity. I personally would see no reason, except maybe making a series of DeepPointers with the same capacity for code purposes (eg. iterating through them).
The capacity still needs to be provided anyway, so either this or forcing it to be the same length of the path is, for me, fine.
There is actually a sound reason to have a capacity instead of a length, for example when a pointer path has different lengths according to the game version (it's a very rare occurrence but it does happen sometimes).
Despite the runtime already allows pointer path resolution with
process.read_pointer_path32()
andprocess.read_pointer_path64()
, sometimes it's more convenient and provides more freedom when pointer paths are defined inside a custom function, then stored in a struct and dereferenced when needed inside the autosplitter logic.This provides an essentially equal implementation of
DeepPointer
from OG LiveSplit, allowing for easier retrieval of memory addresses or values via the definedderef_offsets()
orderef::<T>()
functions.