CvPlayer::getRealPopulation() const
- Defined in
- CvPlayer.cpp, line 10236
- Class
- CvPlayer
- Hook name
CivHooks::CvPlayer_getRealPopulation
Hooks
static bool BeforeCvPlayer_getRealPopulation(const CvPlayer* self, long& result);static void AfterCvPlayer_getRealPopulation(const CvPlayer* self, long& result);static long ReplaceCvPlayer_getRealPopulation(long (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_getRealPopulation>(host, &BeforeCvPlayer_getRealPopulation);CivRegisterAfter<CivHooks::CvPlayer_getRealPopulation>(host, &AfterCvPlayer_getRealPopulation);CivRegisterReplace<CivHooks::CvPlayer_getRealPopulation>(host, &ReplaceCvPlayer_getRealPopulation);
Code
10236long CvPlayer::getRealPopulation() const10237{10238 const CvCity* pLoopCity;10239 __int64 iTotalPopulation = 0;10240 int iLoop = 0;1024110242 for(pLoopCity = firstCity(&iLoop); pLoopCity != NULL; pLoopCity = nextCity(&iLoop))10243 {10244 iTotalPopulation += pLoopCity->getRealPopulation();10245 }1024610247 if(iTotalPopulation > INT_MAX)10248 {10249 iTotalPopulation = INT_MAX;10250 }1025110252 return ((long)(iTotalPopulation));10253}