Bazaar developer reference

CvGame::GetTurnsUntilMinorCivElection()

Defined in
CvGame.cpp, line 10386
Class
CvGame
Hook name
CivHooks::CvGame_GetTurnsUntilMinorCivElection

Hooks

static bool BeforeCvGame_GetTurnsUntilMinorCivElection(CvGame* self, int& result);static void AfterCvGame_GetTurnsUntilMinorCivElection(CvGame* self, int& result);static int ReplaceCvGame_GetTurnsUntilMinorCivElection(int (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_GetTurnsUntilMinorCivElection>(host, &BeforeCvGame_GetTurnsUntilMinorCivElection);CivRegisterAfter<CivHooks::CvGame_GetTurnsUntilMinorCivElection>(host, &AfterCvGame_GetTurnsUntilMinorCivElection);CivRegisterReplace<CivHooks::CvGame_GetTurnsUntilMinorCivElection>(host, &ReplaceCvGame_GetTurnsUntilMinorCivElection);

Code

10386int CvGame::GetTurnsUntilMinorCivElection()10387{10388	int iMod = 0;10389	int iTurnsBetweenCityStateElections = GetTurnsBetweenMinorCivElections();1039010391	if(iTurnsBetweenCityStateElections != 0)10392	{10393		iMod = getGameTurn() % iTurnsBetweenCityStateElections;10394	}10395	if(iMod == 0)10396	{10397		return 0;10398	}10399	else10400	{10401		return iTurnsBetweenCityStateElections - iMod;10402	}10403}

Calls

Called by