Hooks
static bool BeforeCvLuaDeal_lAddVoteCommitment(lua_State* L, int& result);static void AfterCvLuaDeal_lAddVoteCommitment(lua_State* L, int& result);static int ReplaceCvLuaDeal_lAddVoteCommitment(int (*original)(lua_State*), lua_State* L);CivRegisterBefore<CivHooks::CvLuaDeal_lAddVoteCommitment>(host, &BeforeCvLuaDeal_lAddVoteCommitment);CivRegisterAfter<CivHooks::CvLuaDeal_lAddVoteCommitment>(host, &AfterCvLuaDeal_lAddVoteCommitment);CivRegisterReplace<CivHooks::CvLuaDeal_lAddVoteCommitment>(host, &ReplaceCvLuaDeal_lAddVoteCommitment);
Code
182int CvLuaDeal::lAddVoteCommitment(lua_State* L)183{184 CvDeal* pkDeal = GetInstance(L);185 const PlayerTypes eFromPlayer = (PlayerTypes) lua_tointeger(L, 2);186 const int iResolutionID = lua_tointeger(L, 3);187 const int iVoteChoice = lua_tointeger(L, 4);188 const int iNumVotes = lua_tointeger(L, 5);189 const bool bRepeal = lua_toboolean(L, 6);190191 pkDeal->AddVoteCommitment(eFromPlayer, iResolutionID, iVoteChoice, iNumVotes, bRepeal);192 return 0;193}