Bazaar developer reference

CvLuaTeam::lSetHasTech(lua_State *)

Defined in
Lua/CvLuaTeam.cpp, line 1263
Class
CvLuaTeam
Hook name
CivHooks::CvLuaTeam_lSetHasTech

Hooks

static bool BeforeCvLuaTeam_lSetHasTech(lua_State* L, int& result);static void AfterCvLuaTeam_lSetHasTech(lua_State* L, int& result);static int ReplaceCvLuaTeam_lSetHasTech(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaTeam_lSetHasTech>(host, &BeforeCvLuaTeam_lSetHasTech);CivRegisterAfter<CivHooks::CvLuaTeam_lSetHasTech>(host, &AfterCvLuaTeam_lSetHasTech);CivRegisterReplace<CivHooks::CvLuaTeam_lSetHasTech>(host, &ReplaceCvLuaTeam_lSetHasTech);

Code

1262//void setHasTech(TechTypes eIndex, bool bNewValue, PlayerTypes ePlayer, bool bFirst, bool bAnnounce);1263int CvLuaTeam::lSetHasTech(lua_State* L)1264{1265	CvTeam* pkTeam = GetInstance(L);1266	const TechTypes eIndex = (TechTypes)lua_tointeger(L, 2);1267	const bool bNewValue = lua_toboolean(L, 3);1268	const PlayerTypes ePlayer = (PlayerTypes)lua_tointeger(L, 4);12691270#if defined(MOD_BUGFIX_LUA_API)1271	bool bFirst = lua_toboolean(L, 4);1272	bool bAnnounce = lua_toboolean(L, 5);12731274	if (lua_gettop(L) == 6)1275	{1276		bFirst = lua_toboolean(L, 5);1277		bAnnounce = lua_toboolean(L, 6);1278	}1279#else1280	const bool bFirst = lua_toboolean(L, 4);1281	const bool bAnnounce = lua_toboolean(L, 5);1282#endif12831284	pkTeam->setHasTech(eIndex, bNewValue, ePlayer, bFirst, bAnnounce);1285	return 0;1286}

Calls

Called by