Bazaar developer reference

CvLuaMap::lAreasAux(lua_State *)

Defined in
Lua/CvLuaMap.cpp, line 84
Class
CvLuaMap
Hook name
CivHooks::CvLuaMap_lAreasAux

Hooks

static bool BeforeCvLuaMap_lAreasAux(lua_State* L, int& result);static void AfterCvLuaMap_lAreasAux(lua_State* L, int& result);static int ReplaceCvLuaMap_lAreasAux(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaMap_lAreasAux>(host, &BeforeCvLuaMap_lAreasAux);CivRegisterAfter<CivHooks::CvLuaMap_lAreasAux>(host, &AfterCvLuaMap_lAreasAux);CivRegisterReplace<CivHooks::CvLuaMap_lAreasAux>(host, &ReplaceCvLuaMap_lAreasAux);

Code

84int CvLuaMap::lAreasAux(lua_State* L)85{86	int it = 0;87	CvArea* pkArea = NULL;8889	if(lua_isnoneornil(L, 2))90	{91		pkArea = GC.getMap().firstArea(&it);92	}93	else94	{95		it = lua_tointeger(L, 2);96		pkArea = GC.getMap().nextArea(&it);97	}9899	if(pkArea)100	{101		lua_pushinteger(L, it);102		CvLuaArea::Push(L, pkArea);103		return 2;104	}105106	return 0;107}

Calls

Called by