Bazaar developer reference

CvLuaUnit::lCanConstruct(lua_State *)

Defined in
Lua/CvLuaUnit.cpp, line 1458
Class
CvLuaUnit
Hook name
CivHooks::CvLuaUnit_lCanConstruct

Hooks

static bool BeforeCvLuaUnit_lCanConstruct(lua_State* L, int& result);static void AfterCvLuaUnit_lCanConstruct(lua_State* L, int& result);static int ReplaceCvLuaUnit_lCanConstruct(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaUnit_lCanConstruct>(host, &BeforeCvLuaUnit_lCanConstruct);CivRegisterAfter<CivHooks::CvLuaUnit_lCanConstruct>(host, &AfterCvLuaUnit_lCanConstruct);CivRegisterReplace<CivHooks::CvLuaUnit_lCanConstruct>(host, &ReplaceCvLuaUnit_lCanConstruct);

Code

1457//bool canConstruct(CyPlot* pPlot, int /*BuildingTypes*/ eBuilding);1458int CvLuaUnit::lCanConstruct(lua_State* L)1459{1460	CvUnit* pkUnit = GetInstance(L);1461	CvPlot* pkPlot = CvLuaPlot::GetInstance(L, 2);1462	const BuildingTypes eBuilding = (BuildingTypes)lua_tointeger(L, 3);1463	const bool bResult = pkUnit->canConstruct(pkPlot, eBuilding);14641465	lua_pushboolean(L, bResult);1466	return 1;1467}

Calls

Called by