Bazaar developer reference

CvLuaGame::lGetLeague(lua_State *)

Defined in
Lua/CvLuaGame.cpp, line 2703
Class
CvLuaGame
Hook name
CivHooks::CvLuaGame_lGetLeague

Hooks

static bool BeforeCvLuaGame_lGetLeague(lua_State* L, int& result);static void AfterCvLuaGame_lGetLeague(lua_State* L, int& result);static int ReplaceCvLuaGame_lGetLeague(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaGame_lGetLeague>(host, &BeforeCvLuaGame_lGetLeague);CivRegisterAfter<CivHooks::CvLuaGame_lGetLeague>(host, &AfterCvLuaGame_lGetLeague);CivRegisterReplace<CivHooks::CvLuaGame_lGetLeague>(host, &ReplaceCvLuaGame_lGetLeague);

Code

2703int CvLuaGame::lGetLeague(lua_State* L)2704{2705	const LeagueTypes eLeague = (LeagueTypes) lua_tointeger(L, 1);27062707	CvLeague* pLeague = GC.getGame().GetGameLeagues()->GetLeague(eLeague);2708	if (pLeague != NULL)2709	{2710		CvLuaLeague::Push(L, pLeague);2711	}2712	else2713	{2714		lua_pushnil(L);2715	}2716	return 1;2717}

Calls

Called by