Bazaar developer reference

CvLuaMap::lGetRandomResourceQuantity(lua_State *)

Defined in
Lua/CvLuaMap.cpp, line 291
Class
CvLuaMap
Hook name
CivHooks::CvLuaMap_lGetRandomResourceQuantity

Hooks

static bool BeforeCvLuaMap_lGetRandomResourceQuantity(lua_State* L, int& result);static void AfterCvLuaMap_lGetRandomResourceQuantity(lua_State* L, int& result);static int ReplaceCvLuaMap_lGetRandomResourceQuantity(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaMap_lGetRandomResourceQuantity>(host, &BeforeCvLuaMap_lGetRandomResourceQuantity);CivRegisterAfter<CivHooks::CvLuaMap_lGetRandomResourceQuantity>(host, &AfterCvLuaMap_lGetRandomResourceQuantity);CivRegisterReplace<CivHooks::CvLuaMap_lGetRandomResourceQuantity>(host, &ReplaceCvLuaMap_lGetRandomResourceQuantity);

Code

291int CvLuaMap::lGetRandomResourceQuantity(lua_State* L)292{293	const ResourceTypes eResource = (ResourceTypes)luaL_checkinteger(L, 1);294295	const int iResult = GC.getMap().getRandomResourceQuantity(eResource);296	lua_pushinteger(L, iResult);297	return 1;298}

Calls

Called by