CvGame::SetPreviousVoteCast(TeamTypes, TeamTypes)
- Defined in
- CvGame.cpp, line 5392
- Class
- CvGame
- Hook name
CivHooks::CvGame_SetPreviousVoteCast
Hooks
static bool BeforeCvGame_SetPreviousVoteCast(CvGame* self, TeamTypes eVotingTeam, TeamTypes eVotingTarget);static void AfterCvGame_SetPreviousVoteCast(CvGame* self, TeamTypes eVotingTeam, TeamTypes eVotingTarget);static void ReplaceCvGame_SetPreviousVoteCast(void (*original)(CvGame*, TeamTypes, TeamTypes), CvGame* self, TeamTypes eVotingTeam, TeamTypes eVotingTarget);CivRegisterBefore<CivHooks::CvGame_SetPreviousVoteCast>(host, &BeforeCvGame_SetPreviousVoteCast);CivRegisterAfter<CivHooks::CvGame_SetPreviousVoteCast>(host, &AfterCvGame_SetPreviousVoteCast);CivRegisterReplace<CivHooks::CvGame_SetPreviousVoteCast>(host, &ReplaceCvGame_SetPreviousVoteCast);
Code
5391/// Set the last vote this team made, for record keeping5392void CvGame::SetPreviousVoteCast(TeamTypes eVotingTeam, TeamTypes eVotingTarget)5393{5394 CvAssertMsg(eVotingTeam >= 0, "eVotingTeam is expected to be non-negative (invalid Index)");5395 CvAssertMsg(eVotingTeam < MAX_CIV_TEAMS, "eVotingTeam is expected to be within maximum bounds (invalid Index)");5396 if (eVotingTeam < 0 || eVotingTeam >= MAX_CIV_TEAMS) return;53975398 if (eVotingTarget != GetPreviousVoteCast(eVotingTeam))5399 {5400 m_aiPreviousVotesCast[eVotingTeam] = eVotingTarget;5401 }5402}