CvDiplomacyRequests::DoAIDiplomacyWithHumans()
- Defined in
- CvDiplomacyRequests.cpp, line 519
- Class
- CvDiplomacyRequests
- Hook name
CivHooks::CvDiplomacyRequests_DoAIDiplomacyWithHumans
Hooks
static bool BeforeCvDiplomacyRequests_DoAIDiplomacyWithHumans();static void AfterCvDiplomacyRequests_DoAIDiplomacyWithHumans();static void ReplaceCvDiplomacyRequests_DoAIDiplomacyWithHumans(void (*original)());CivRegisterBefore<CivHooks::CvDiplomacyRequests_DoAIDiplomacyWithHumans>(host, &BeforeCvDiplomacyRequests_DoAIDiplomacyWithHumans);CivRegisterAfter<CivHooks::CvDiplomacyRequests_DoAIDiplomacyWithHumans>(host, &AfterCvDiplomacyRequests_DoAIDiplomacyWithHumans);CivRegisterReplace<CivHooks::CvDiplomacyRequests_DoAIDiplomacyWithHumans>(host, &ReplaceCvDiplomacyRequests_DoAIDiplomacyWithHumans);
Code
516// Have all the AIs do a diplomacy evaluation with the turn active human players.517// Please note that the destination player may not be the active player.518// static519void CvDiplomacyRequests::DoAIDiplomacyWithHumans()520{521 if (s_aDiploHumans.size() == 0)522 return;523524 // just loop through all ai players and to diplomacy with active humans525 for (int i = 0; i < MAX_CIV_PLAYERS; ++i)526 {527 CvPlayer& kPlayer = GET_PLAYER((PlayerTypes)i);528 if (kPlayer.isAlive() && !kPlayer.isHuman() && !kPlayer.isMinorCiv() && !kPlayer.isBarbarian())529 {530 kPlayer.GetDiplomacyAI()->DoTurn(NO_PLAYER, DIPLO_HUMAN_PLAYERS);531 }532 }533534 s_aDiploHumans.clear();535}