mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Backport the modern structured-table accessor. Vanilla's global GetContainerItemInfo (Script_GetContainerItemInfo, 0x004F9670) returns only a flat texture/itemCount/locked/quality/readable tuple; assemble the full ContainerItemInfo table from the same descriptor + item-cache sources plus the fields 1.12 never surfaced (hyperlink, hasNoValue, itemID, isBound, itemName). Live per-instance fields (stackCount, isLocked, isBound, itemID, hyperlink) are always present; cache-derived fields (iconFileID, quality, hasLoot, hasNoValue, itemName) are omitted/nil until the item's static data lands. Reuses Item::StatAccum::FetchRecord and Item::Link for the cache peek and link/name build (no new duplication); gathers all data into locals before building the table so the engine link/name builders never interleave with the half-built table on the Lua stack. readable mirrors the engine branch at 0x004F97BD (static page text OR the per-instance readable-text id at descriptor +0x9C, added as OFF_DESCRIPTOR_READABLE_TEXT_ID). hasLoot is a best-effort static LOOTABLE approximation (vanilla can't track post-loot emptiness client-side).