Bazaar developer reference

CvLuaCity::lGetBuyablePlotList(lua_State *)

Defined in
Lua/CvLuaCity.cpp, line 2050
Class
CvLuaCity
Hook name
CivHooks::CvLuaCity_lGetBuyablePlotList

Hooks

static bool BeforeCvLuaCity_lGetBuyablePlotList(lua_State* L, int& result);static void AfterCvLuaCity_lGetBuyablePlotList(lua_State* L, int& result);static int ReplaceCvLuaCity_lGetBuyablePlotList(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaCity_lGetBuyablePlotList>(host, &BeforeCvLuaCity_lGetBuyablePlotList);CivRegisterAfter<CivHooks::CvLuaCity_lGetBuyablePlotList>(host, &AfterCvLuaCity_lGetBuyablePlotList);CivRegisterReplace<CivHooks::CvLuaCity_lGetBuyablePlotList>(host, &ReplaceCvLuaCity_lGetBuyablePlotList);

Code

2050int CvLuaCity::lGetBuyablePlotList(lua_State* L)2051{2052	CvCity* pkCity = GetInstance(L);2053	std::vector<int> aiPlotList;2054	aiPlotList.resize(20, -1);2055	pkCity->GetBuyablePlotList(aiPlotList);20562057	int iReturnValues = 0;20582059	for(uint ui = 0; ui < aiPlotList.size(); ui++)2060	{2061		if(aiPlotList[ui] >= 0)2062		{2063			CvPlot* pkPlot = GC.getMap().plotByIndex(aiPlotList[ui]);2064			CvLuaPlot::Push(L, pkPlot);2065			iReturnValues++;2066		}2067		else2068		{2069			break;2070		}2071	}20722073	return iReturnValues;2074}

Calls

Called by