Hooks
static bool BeforeCvLuaLeague_lGetChoicesForDecision(lua_State* L, int& result);static void AfterCvLuaLeague_lGetChoicesForDecision(lua_State* L, int& result);static int ReplaceCvLuaLeague_lGetChoicesForDecision(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaLeague_lGetChoicesForDecision>(host, &BeforeCvLuaLeague_lGetChoicesForDecision);CivRegisterAfter<CivHooks::CvLuaLeague_lGetChoicesForDecision>(host, &AfterCvLuaLeague_lGetChoicesForDecision);CivRegisterReplace<CivHooks::CvLuaLeague_lGetChoicesForDecision>(host, &ReplaceCvLuaLeague_lGetChoicesForDecision);
Code
240//table GetChoicesForDecision(ResolutionDecisionTypes eDecision, PlayerTypes eDecider);241int CvLuaLeague::lGetChoicesForDecision(lua_State* L)242{243 CvLeague* pLeague = GetInstance(L);244 const ResolutionDecisionTypes eDecision = (ResolutionDecisionTypes) lua_tointeger(L, 2);245 const PlayerTypes eDecider = (PlayerTypes) lua_tointeger(L, 3);246247 lua_createtable(L, 0, 0);248 const int t = lua_gettop(L);249 int iIndex = 1;250251 std::vector<int> v = pLeague->GetChoicesForDecision(eDecision, eDecider);252 for (std::vector<int>::iterator it = v.begin(); it != v.end(); it++)253 {254 const int iChoice = (*it);255 lua_pushinteger(L, iChoice);256 lua_rawseti(L, t, iIndex++);257 }258 return 1;259}