Bazaar developer reference

CvGame::countHumanPlayersAlive() const

Defined in
CvGame.cpp, line 3881
Class
CvGame
Hook name
CivHooks::CvGame_countHumanPlayersAlive

Hooks

static bool BeforeCvGame_countHumanPlayersAlive(const CvGame* self, int& result);static void AfterCvGame_countHumanPlayersAlive(const CvGame* self, int& result);static int ReplaceCvGame_countHumanPlayersAlive(int (*original)(const CvGame*), const CvGame* self);CivRegisterBefore<CivHooks::CvGame_countHumanPlayersAlive>(host, &BeforeCvGame_countHumanPlayersAlive);CivRegisterAfter<CivHooks::CvGame_countHumanPlayersAlive>(host, &AfterCvGame_countHumanPlayersAlive);CivRegisterReplace<CivHooks::CvGame_countHumanPlayersAlive>(host, &ReplaceCvGame_countHumanPlayersAlive);

Code

3881int CvGame::countHumanPlayersAlive() const3882{3883	int iCount;3884	int iI;38853886	iCount = 0;38873888	for(iI = 0; iI < MAX_CIV_PLAYERS; iI++)3889	{3890		if(GET_PLAYER((PlayerTypes)iI).isAlive())3891		{3892			if(GET_PLAYER((PlayerTypes)iI).isHuman())3893			{3894				iCount++;3895			}3896		}3897	}38983899	return iCount;3900}

Calls

Called by