mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
Re-registers the standard five entries (create / resume / yield / status / wrap) on the global `coroutine` table. The C-level machinery (lua_resume, lua_yield, lua_newthread, threads as tag 8) was always linked into the engine; only the script-side library was stripped from the registration tables at build time. Two WoW-specific quirks discovered along the way and worked around: - `lua_resume` returns 1 for BOTH yield and caught runtime error. Disambiguated by checking `co->ci > co->base_ci` — a yielded coroutine still has its body frame on the call stack; an errored one has been unwound to base_ci. - The byte at L+0x31 is `allowhook` (saved/restored around protected calls), not `L->status` as it initially looked. Status reading is replaced by the ci comparison above.