Bazaar developer reference

CvGame::updateWar()

Defined in
CvGame.cpp, line 8248
Class
CvGame
Hook name
CivHooks::CvGame_updateWar

Hooks

static bool BeforeCvGame_updateWar(CvGame* self);static void AfterCvGame_updateWar(CvGame* self);static void ReplaceCvGame_updateWar(void (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_updateWar>(host, &BeforeCvGame_updateWar);CivRegisterAfter<CivHooks::CvGame_updateWar>(host, &AfterCvGame_updateWar);CivRegisterReplace<CivHooks::CvGame_updateWar>(host, &ReplaceCvGame_updateWar);

Code

8248void CvGame::updateWar()8249{8250	int iI, iJ;82518252	if(isOption(GAMEOPTION_ALWAYS_WAR))8253	{8254		for(iI = 0; iI < MAX_TEAMS; iI++)8255		{8256			CvTeam& teamI = GET_TEAM((TeamTypes)iI);8257			if(teamI.isHuman())8258			{8259				if(teamI.isAlive())8260				{8261					for(iJ = 0; iJ < MAX_TEAMS; iJ++)8262					{8263						CvTeam& teamJ = GET_TEAM((TeamTypes)iJ);8264						if(!(teamJ.isHuman()))8265						{8266							if(teamJ.isAlive())8267							{8268								if(iI != iJ)8269								{8270									if(teamI.isHasMet((TeamTypes)iJ))8271									{8272										if(!atWar(((TeamTypes)iI), ((TeamTypes)iJ)))8273										{8274#if defined(MOD_EVENTS_WAR_AND_PEACE)8275											teamI.declareWar(((TeamTypes)iJ), false, teamI.getLeaderID());8276#else8277											teamI.declareWar(((TeamTypes)iJ));8278#endif8279										}8280									}8281								}8282							}8283						}8284					}8285				}8286			}8287		}8288	}8289}

Calls

Called by