CvGame::updateTimers()
- Defined in
- CvGame.cpp, line 8610
- Class
- CvGame
- Hook name
CivHooks::CvGame_updateTimers
Hooks
static bool BeforeCvGame_updateTimers(CvGame* self);static void AfterCvGame_updateTimers(CvGame* self);static void ReplaceCvGame_updateTimers(void (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_updateTimers>(host, &BeforeCvGame_updateTimers);CivRegisterAfter<CivHooks::CvGame_updateTimers>(host, &AfterCvGame_updateTimers);CivRegisterReplace<CivHooks::CvGame_updateTimers>(host, &ReplaceCvGame_updateTimers);
Code
8610void CvGame::updateTimers()8611{8612 int iI;86138614 for(iI = 0; iI < MAX_PLAYERS; iI++)8615 {8616 CvPlayer& kPlayer = GET_PLAYER((PlayerTypes)iI);8617 if(kPlayer.isAlive())8618 {8619 kPlayer.updateTimers();8620 }8621 }86228623#if defined(MOD_AI_MP_DIPLOMACY)8624 if (!MOD_AI_MP_DIPLOMACY) {8625#endif8626 if(isHotSeat())8627 {8628 // For Hot Seat, all the AIs will get a chance to do diplomacy with the active human player8629 PlayerTypes eActivePlayer = getActivePlayer();8630 if(eActivePlayer != NO_PLAYER)8631 {8632 CvPlayer& kActivePlayer = GET_PLAYER(eActivePlayer);8633 if(kActivePlayer.isAlive() && kActivePlayer.isHuman() && kActivePlayer.isTurnActive())8634 CvDiplomacyRequests::DoAIDiplomacy(eActivePlayer);8635 }8636 }8637#if defined(MOD_AI_MP_DIPLOMACY)8638 }8639#endif8640}