Code
2438/// See if the wars we are fighting have changed status2439void CvMilitaryAI::UpdateWars()2440{2441 AI_PERF_FORMAT("Military-AI-perf.csv", ("UpdateWars, Turn %03d, %s", GC.getGame().getElapsedGameTurns(), m_pPlayer->getCivilizationShortDescription()) );24422443 WarStateTypes eWarState;24442445 PlayerTypes eLoopPlayer;2446 for(int iPlayerLoop = 0; iPlayerLoop < MAX_MAJOR_CIVS; iPlayerLoop++)2447 {2448 eLoopPlayer = (PlayerTypes) iPlayerLoop;24492450 // Is this a player we have relations with?2451 if(eLoopPlayer != m_pPlayer->GetID() && m_pDiplomacyAI->IsPlayerValid(eLoopPlayer))2452 {2453 eWarState = m_pDiplomacyAI->GetWarState(eLoopPlayer);2454 if(eWarState != m_paeLastTurnWarState[eLoopPlayer])2455 {2456 WarStateChange(eLoopPlayer, eWarState, (WarStateTypes)m_paeLastTurnWarState[eLoopPlayer]);24572458 // Save off new value2459 m_paeLastTurnWarState[eLoopPlayer] = eWarState;2460 }2461 }2462 }2463}