Usage of RegisterProcessor to hook a function in program memory creates a race condition that depends on the result of the hook not to resolve while the thread that owns the lua state is modifying it. The solution should be to find the location in CivilizationVI.exe that handles the game's lua event loop (or whatever other dispatch system is being used) and hook into it, or to reverse the ScriptSystem, ScriptSystemArgs, and TypedVariantMap structures and just use the existing processor system.
This bug was first reported to me 08/03/2024 and since 08/08/2024, fixing it has been this project's top priority. Unfortunately, I've been largely unsuccessful.
Critical bug
Usage of
RegisterProcessor
to hook a function in program memory creates a race condition that depends on the result of the hook not to resolve while the thread that owns the lua state is modifying it. The solution should be to find the location in CivilizationVI.exe that handles the game's lua event loop (or whatever other dispatch system is being used) and hook into it, or to reverse theScriptSystem
,ScriptSystemArgs
, andTypedVariantMap
structures and just use the existing processor system.This bug was first reported to me 08/03/2024 and since 08/08/2024, fixing it has been this project's top priority. Unfortunately, I've been largely unsuccessful.