Bazaar developer reference

CvLuaGame::lSpewTestEvents(lua_State *)

Defined in
Lua/CvLuaGame.cpp, line 3195
Class
CvLuaGame
Not a hook point
member without a separate declaration
Lua events
GameEvents.TestEvent, GameEvents.TestAccumulator

Code

3195int CvLuaGame::lSpewTestEvents(lua_State* L)3196{3197	const int iLimit = luaL_optint(L, 1, 1000);31983199	int iValue = 0;3200	const ULONGLONG startTick = GetTickCount64();32013202	if (iLimit > 0) {3203		for (int i = 0; i < iLimit; ++i) {3204			ICvEngineScriptSystem1* pkScriptSystem = gDLL->GetScriptSystem();3205			if (pkScriptSystem) {3206				CvLuaArgsHandle args;3207				args->Push(-1);3208				args->Push(-1);3209				args->Push(-1);3210				args->Push(-1);32113212				bool bResult;3213				LuaSupport::CallHook(pkScriptSystem, "TestEvent", args.get(), bResult);3214			}3215		}3216	} else {3217		ICvEngineScriptSystem1* pkScriptSystem = gDLL->GetScriptSystem();3218		if (pkScriptSystem) {3219			CvLuaArgsHandle args;3220			args->Push(-1);3221			args->Push(-1);3222			args->Push(-1);3223			args->Push(-1);32243225			LuaSupport::CallAccumulator(pkScriptSystem, "TestAccumulator", args.get(), iValue);3226		}3227	}32283229	const ULONGLONG endTick = GetTickCount64();32303231	lua_pushinteger(L, ((int) (endTick - startTick) / 1000));3232	lua_pushinteger(L, ((int) (endTick - startTick) % 1000));3233	lua_pushinteger(L, iValue);3234	return 3;3235}

Calls

Called by