Hooks
static bool BeforeLuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float(ICvEngineScriptSystem1* pkScriptSystem, const char* szName, ICvEngineScriptSystemArgs1* args, float& value, bool& result);static void AfterLuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float(ICvEngineScriptSystem1* pkScriptSystem, const char* szName, ICvEngineScriptSystemArgs1* args, float& value, bool& result);static bool ReplaceLuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float(bool (*original)(ICvEngineScriptSystem1*, const char*, ICvEngineScriptSystemArgs1*, float&), ICvEngineScriptSystem1* pkScriptSystem, const char* szName, ICvEngineScriptSystemArgs1* args, float& value);CivRegisterBefore<CivHooks::LuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float>(host, &BeforeLuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float);CivRegisterAfter<CivHooks::LuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float>(host, &AfterLuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float);CivRegisterReplace<CivHooks::LuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float>(host, &ReplaceLuaSupport_CallAccumulator_with_ICvEngineScriptSystem1_const_char_ICvEngineScriptSystemArgs1_float);
Code
124bool LuaSupport::CallAccumulator(_In_ ICvEngineScriptSystem1* pkScriptSystem, _In_z_ const char* szName, _In_opt_ ICvEngineScriptSystemArgs1* args, float& value)125{126 // Must release our lock so that if the main thread has the Lua lock and is waiting for the Game Core lock, we don't freeze127 bool bHadLock = gDLL->HasGameCoreLock();128 if(bHadLock)129 gDLL->ReleaseGameCoreLock();130 bool bResult = pkScriptSystem->CallAccumulator(szName, args, value);131 if(bHadLock)132 gDLL->GetGameCoreLock();133 return bResult;134}