Bazaar developer reference

CvLuaCity::lIsBuildingSellable(lua_State *)

Defined in
Lua/CvLuaCity.cpp, line 4013
Class
CvLuaCity
Hook name
CivHooks::CvLuaCity_lIsBuildingSellable

Hooks

static bool BeforeCvLuaCity_lIsBuildingSellable(lua_State* L, int& result);static void AfterCvLuaCity_lIsBuildingSellable(lua_State* L, int& result);static int ReplaceCvLuaCity_lIsBuildingSellable(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lIsBuildingSellable>(host, &BeforeCvLuaCity_lIsBuildingSellable);CivRegisterAfter<CivHooks::CvLuaCity_lIsBuildingSellable>(host, &AfterCvLuaCity_lIsBuildingSellable);CivRegisterReplace<CivHooks::CvLuaCity_lIsBuildingSellable>(host, &ReplaceCvLuaCity_lIsBuildingSellable);

Code

4012//bool IsBuildingSellable(BuildingTypes iIndex);4013int CvLuaCity::lIsBuildingSellable(lua_State* L)4014{4015	bool bResult = false;4016	CvCity* pkCity = GetInstance(L);4017	const BuildingTypes iIndex = toValue<BuildingTypes>(L, 2);4018	if(iIndex != NO_BUILDING)4019	{4020		CvBuildingEntry* pkBuildingInfo = GC.getBuildingInfo(iIndex);4021		if(pkBuildingInfo)4022		{4023			bResult = pkCity->GetCityBuildings()->IsBuildingSellable(*pkBuildingInfo);4024		}4025	}40264027	lua_pushboolean(L, bResult);4028	return 1;4029}

Calls

Called by