mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
4.3.4's CSimpleFrame::LoadXML reads an <Attributes> child through LoadXML_Attributes; 1.12's frame loader (FUN_XML_FRAME_LOAD) walks its child elements and silently skips the unknown one, so ported templates lost every attribute. Each <Attribute name= type= value=> is now set the way 4.3.4 sets it: type nil/boolean/number/string (default), converted with the loader's own helpers (FUN_XML_ATTR_TO_BOOL, new FUN_SSTR_TO_FLOAT), stored without firing OnAttributeChanged (through our SetAttributeNoHandler, so unit/type* behave as when set from Lua), and malformed entries logged through the loader's status sink with 4.3.4's warning texts (VTBL_XML_STATUS_ADD, level 1). FUN_XML_FRAME_LOAD was already hooked by Xml::ParentKey, and MinHook takes one hook per address, so Xml::FrameLoad now owns it and fans out after the engine loads each node (the RunnerHook / WorldTick pattern). ParentKey's frame binds and the attribute loader subscribe; its node helpers and loader-safe wrapper push moved there too. OFF_COBJECT_LUA_REGISTRY_REF duplicated OFF_COBJECT_LUA_REF (both 0x08) and is folded into it. Verified in-game with a test addon: template attributes inherited and overridden by the frame's own, number / boolean / nil types, a mixed- case name, values present by OnLoad, no OnAttributeChanged on load, and the three FrameXML.log warnings.