CvPreGame::numDefinedPlayers()
- Defined in
- CvPreGame.cpp, line 1639
- Hook name
CivHooks::CvPreGame_numDefinedPlayers
Hooks
static bool BeforeCvPreGame_numDefinedPlayers(int& result);static void AfterCvPreGame_numDefinedPlayers(int& result);static int ReplaceCvPreGame_numDefinedPlayers(int (*original)());CivRegisterBefore<CivHooks::CvPreGame_numDefinedPlayers>(host, &BeforeCvPreGame_numDefinedPlayers);CivRegisterAfter<CivHooks::CvPreGame_numDefinedPlayers>(host, &AfterCvPreGame_numDefinedPlayers);CivRegisterReplace<CivHooks::CvPreGame_numDefinedPlayers>(host, &ReplaceCvPreGame_numDefinedPlayers);
Code
1639int numDefinedPlayers()1640{1641 int iCount = 0;1642 for(int i = 0; i < MAX_CIV_PLAYERS; ++i)1643 {1644 if((civilization((PlayerTypes)i) != NO_CIVILIZATION) && (leaderHead((PlayerTypes)i) != NO_LEADER))1645 {1646 iCount++;1647 }1648 }1649 return iCount;1650}