Bazaar developer reference

CvLuaCity::lCanCreate(lua_State *)

Defined in
Lua/CvLuaCity.cpp, line 905
Class
CvLuaCity
Hook name
CivHooks::CvLuaCity_lCanCreate

Hooks

static bool BeforeCvLuaCity_lCanCreate(lua_State* L, int& result);static void AfterCvLuaCity_lCanCreate(lua_State* L, int& result);static int ReplaceCvLuaCity_lCanCreate(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lCanCreate>(host, &BeforeCvLuaCity_lCanCreate);CivRegisterAfter<CivHooks::CvLuaCity_lCanCreate>(host, &AfterCvLuaCity_lCanCreate);CivRegisterReplace<CivHooks::CvLuaCity_lCanCreate>(host, &ReplaceCvLuaCity_lCanCreate);

Code

904//bool canCreate( int iProject, bool bContinue, bool bTestVisible );905int CvLuaCity::lCanCreate(lua_State* L)906{907	CvCity* pkCity = GetInstance(L);908	const int iProject = lua_tointeger(L, 2);909	const bool bContinue = luaL_optint(L, 3, 0);910	const bool bTestVisible = luaL_optint(L, 4, 0);911	const bool bResult = pkCity->canCreate((ProjectTypes)iProject, bContinue, bTestVisible);912913	lua_pushboolean(L, bResult);914	return 1;915}

Calls

Called by