CvLeague::DoVoteAbstain(PlayerTypes, int)
- Defined in
- CvVotingClasses.cpp, line 2268
- Class
- CvLeague
- Hook name
CivHooks::CvLeague_DoVoteAbstain
Hooks
static bool BeforeCvLeague_DoVoteAbstain(CvLeague* self, PlayerTypes eVoter, int iNumVotes);static void AfterCvLeague_DoVoteAbstain(CvLeague* self, PlayerTypes eVoter, int iNumVotes);static void ReplaceCvLeague_DoVoteAbstain(void (*original)(CvLeague*, PlayerTypes, int), CvLeague* self, PlayerTypes eVoter, int iNumVotes);CivRegisterBefore<CivHooks::CvLeague_DoVoteAbstain>(host, &BeforeCvLeague_DoVoteAbstain);CivRegisterAfter<CivHooks::CvLeague_DoVoteAbstain>(host, &AfterCvLeague_DoVoteAbstain);CivRegisterReplace<CivHooks::CvLeague_DoVoteAbstain>(host, &ReplaceCvLeague_DoVoteAbstain);
Code
2268void CvLeague::DoVoteAbstain(PlayerTypes eVoter, int iNumVotes)2269{2270 bool bProcessed = false;2271 if (CanVote(eVoter) && GetRemainingVotesForMember(eVoter) >= iNumVotes)2272 {2273 GetMember(eVoter)->iVotes -= iNumVotes;2274 GetMember(eVoter)->iAbstainedVotes += iNumVotes;2275 CvAssertMsg(GetRemainingVotesForMember(eVoter) >= 0, "A voter now has negative votes remaining. Please send Anton your save file and version.");2276 bProcessed = true;2277 }2278 CvAssertMsg(bProcessed, "Attempt to abstain votes but not allowed to. Please send Anton your save file and version.");2279 GC.GetEngineUserInterface()->setDirty(LeagueScreen_DIRTY_BIT, true);2280}