CvGame::initDiplomacy()
- Defined in
- CvGame.cpp, line 1305
- Class
- CvGame
- Hook name
CivHooks::CvGame_initDiplomacy
Hooks
static bool BeforeCvGame_initDiplomacy(CvGame* self);static void AfterCvGame_initDiplomacy(CvGame* self);static void ReplaceCvGame_initDiplomacy(void (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_initDiplomacy>(host, &BeforeCvGame_initDiplomacy);CivRegisterAfter<CivHooks::CvGame_initDiplomacy>(host, &AfterCvGame_initDiplomacy);CivRegisterReplace<CivHooks::CvGame_initDiplomacy>(host, &ReplaceCvGame_initDiplomacy);
Code
1304/// Initial diplomacy State: right now this just has all teams meet themselves and sets them at war with the Barbs1305void CvGame::initDiplomacy()1306{1307 for(int iI = 0; iI < MAX_TEAMS; iI++)1308 {1309 const TeamTypes eTeamA = static_cast<TeamTypes>(iI);1310 CvTeam& kTeamA = GET_TEAM(eTeamA);1311 kTeamA.meet(eTeamA, false);13121313 if(kTeamA.isBarbarian())1314 {1315 for(int iJ = 0; iJ < MAX_CIV_TEAMS; iJ++)1316 {1317 const TeamTypes eTeamB = static_cast<TeamTypes>(iJ);1318 if(iI != iJ)1319 {1320#if defined(MOD_EVENTS_WAR_AND_PEACE)1321 kTeamA.declareWar(eTeamB, false, kTeamA.getLeaderID());1322#else1323 kTeamA.declareWar(eTeamB);1324#endif1325 }1326 }1327 }1328 }1329}