Bazaar developer reference

CvLuaCity::lSetPopulation(lua_State *)

Defined in
Lua/CvLuaCity.cpp, line 2123
Class
CvLuaCity
Hook name
CivHooks::CvLuaCity_lSetPopulation

Hooks

static bool BeforeCvLuaCity_lSetPopulation(lua_State* L, int& result);static void AfterCvLuaCity_lSetPopulation(lua_State* L, int& result);static int ReplaceCvLuaCity_lSetPopulation(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lSetPopulation>(host, &BeforeCvLuaCity_lSetPopulation);CivRegisterAfter<CivHooks::CvLuaCity_lSetPopulation>(host, &AfterCvLuaCity_lSetPopulation);CivRegisterReplace<CivHooks::CvLuaCity_lSetPopulation>(host, &ReplaceCvLuaCity_lSetPopulation);

Code

2122//void setPopulation(int iNewValue);2123int CvLuaCity::lSetPopulation(lua_State* L)2124{2125	CvCity* pkCity = GetInstance(L);2126	int iValue = lua_tointeger(L, 2);2127	int bReassignPop = lua_toboolean(L, 3);2128	CvAssertMsg(bReassignPop != 0, "It is super dangerous to set this to false.  Ken would love to see why you are doing this.");2129	pkCity->setPopulation(iValue, bReassignPop);21302131	return 1;2132//	return BasicLuaMethod(L, &CvCity::setPopulation);2133}

Calls

Called by