Bazaar developer reference

CvLuaCity::lGetNumSpecialistsAllowedByBuilding(lua_State *)

Defined in
Lua/CvLuaCity.cpp, line 3611
Class
CvLuaCity
Hook name
CivHooks::CvLuaCity_lGetNumSpecialistsAllowedByBuilding

Hooks

static bool BeforeCvLuaCity_lGetNumSpecialistsAllowedByBuilding(lua_State* L, int& result);static void AfterCvLuaCity_lGetNumSpecialistsAllowedByBuilding(lua_State* L, int& result);static int ReplaceCvLuaCity_lGetNumSpecialistsAllowedByBuilding(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lGetNumSpecialistsAllowedByBuilding>(host, &BeforeCvLuaCity_lGetNumSpecialistsAllowedByBuilding);CivRegisterAfter<CivHooks::CvLuaCity_lGetNumSpecialistsAllowedByBuilding>(host, &AfterCvLuaCity_lGetNumSpecialistsAllowedByBuilding);CivRegisterReplace<CivHooks::CvLuaCity_lGetNumSpecialistsAllowedByBuilding>(host, &ReplaceCvLuaCity_lGetNumSpecialistsAllowedByBuilding);

Code

3610//int GetNumSpecialistsAllowedByBuilding(BuildingTypes eBuilding);3611int CvLuaCity::lGetNumSpecialistsAllowedByBuilding(lua_State* L)3612{3613	int iResult = 0;3614	CvCity* pkCity = GetInstance(L);3615	BuildingTypes bt = toValue<BuildingTypes>(L, 2);3616	if(bt != NO_BUILDING)3617	{3618		CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(bt);3619		if(pkBuildingInfo)3620		{3621			iResult = pkCity->GetCityCitizens()->GetNumSpecialistsAllowedByBuilding(*pkBuildingInfo);3622		}3623	}36243625	lua_pushinteger(L, iResult);3626	return 1;3627}

Calls

Called by