Bazaar developer reference

CvLuaCity::lIsHoldingGreatWork(lua_State *)

Defined in
Lua/CvLuaCity.cpp, line 4085
Class
CvLuaCity
Hook name
CivHooks::CvLuaCity_lIsHoldingGreatWork

Hooks

static bool BeforeCvLuaCity_lIsHoldingGreatWork(lua_State* L, int& result);static void AfterCvLuaCity_lIsHoldingGreatWork(lua_State* L, int& result);static int ReplaceCvLuaCity_lIsHoldingGreatWork(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lIsHoldingGreatWork>(host, &BeforeCvLuaCity_lIsHoldingGreatWork);CivRegisterAfter<CivHooks::CvLuaCity_lIsHoldingGreatWork>(host, &AfterCvLuaCity_lIsHoldingGreatWork);CivRegisterReplace<CivHooks::CvLuaCity_lIsHoldingGreatWork>(host, &ReplaceCvLuaCity_lIsHoldingGreatWork);

Code

4084//int IsHoldingGreatWork(BuildingClassTypes eBuildingClass) const;4085int CvLuaCity::lIsHoldingGreatWork(lua_State* L)4086{4087	bool bResult = false;4088	CvCity* pkCity = GetInstance(L);4089	const BuildingClassTypes iIndex = toValue<BuildingClassTypes>(L, 2);4090	if(iIndex != NO_BUILDINGCLASS)4091	{4092		CvBuildingClassInfo* pkBuildingClassInfo = GC.getBuildingClassInfo(iIndex);4093		if(pkBuildingClassInfo)4094		{4095			bResult = pkCity->GetCityBuildings()->IsHoldingGreatWork(iIndex);4096		}4097	}4098	lua_pushboolean(L, bResult);4099	return 1;4100}

Calls

Called by