mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-15 23:50:38 +00:00
The three macro-icon scan callbacks were named and tagged for the wrong walker. FUN_LOAD_MACRO_ICONS hands 0x004F0220 to FUN_MPQ_ENUM_FILES (the archive listfile walk) and 0x004F0350 / 0x004F04F0 to the disk walker, but Icons.cpp had it exactly inverted: the archive pass was tagged SRC_LOOSE and both disk passes SRC_MPQ. So GetMacroIcons / GetMacroItemIcons returned the loose on-disk icons -- nothing at all on a stock install -- while GetLooseMacroIcons / GetLooseMacroItemIcons returned the archive set. It went unnoticed because the only consumer, IconDataProviderMixin, calls all four and concatenates, so only the ordering within each list changed and never the content. Tags corrected, and the offsets renamed to what the loader actually hands them to, with each one's filter recorded since that is the load-bearing difference between the two disk passes: FUN_MACRO_ICON_CB_DISK -> FUN_MACRO_ICON_CB_MPQ FUN_MACRO_ICON_CB_USER_MPQ -> FUN_MACRO_ICON_CB_DISK_PREFIXED FUN_MACRO_ICON_CB_INSTALL_MPQ -> FUN_MACRO_ICON_CB_DISK_ANY Also replaces a wrong guess in the Offsets.h block. It claimed a filter inside the SStrDup/array-append helpers downstream of all three callbacks was what kept INV_* out of the engine's own list. Decompiling the loader and all three callbacks shows there is no shared downstream helper at all: the grow-and-append code is inlined identically into each callback, so the only filtering is what each one does itself. The list is Ability_*/Spell_* only because passes 1-2 prefix-filter and pass 3 -- the one that does not -- is a disk walk over a folder that ships empty. A loose INV_*.blp dropped into Interface\Icons\ does enter the list, through pass 3 alone. The block now also records the qsort + adjacent SStrCmpI dedup, that GetMacroIconInfo pushes the empty string rather than nil for a bad index, and that only GetNumMacroIcons triggers the lazy build. Verified in-game.