Bazaar developer reference

CvLuaGame::lChangeNukesExploded(lua_State *)

Defined in
Lua/CvLuaGame.cpp, line 1079
Class
CvLuaGame
Hook name
CivHooks::CvLuaGame_lChangeNukesExploded

Hooks

static bool BeforeCvLuaGame_lChangeNukesExploded(lua_State* L, int& result);static void AfterCvLuaGame_lChangeNukesExploded(lua_State* L, int& result);static int ReplaceCvLuaGame_lChangeNukesExploded(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaGame_lChangeNukesExploded>(host, &BeforeCvLuaGame_lChangeNukesExploded);CivRegisterAfter<CivHooks::CvLuaGame_lChangeNukesExploded>(host, &AfterCvLuaGame_lChangeNukesExploded);CivRegisterReplace<CivHooks::CvLuaGame_lChangeNukesExploded>(host, &ReplaceCvLuaGame_lChangeNukesExploded);

Code

1078//void changeNukesExploded(int iChange);1079int CvLuaGame::lChangeNukesExploded(lua_State* L)1080{1081#if defined(MOD_BUGFIX_LUA_API)1082	int iNumNukes;1083	if (lua_gettop(L) == 1)1084		iNumNukes = lua_tointeger(L, 1); // The correct Game.ChangeNukesExploded() usage1085	else1086		iNumNukes = lua_tointeger(L, 2); // The incorrect (but as used by the game core .lua files) Game:ChangeNukesExploded() usage1087#else1088	int iNumNukes = lua_tointeger(L, 2);1089#endif1090	GC.getGame().changeNukesExploded(iNumNukes);1091	return 1;1092}

Calls

Called by