Bazaar developer reference

CvDiplomacyAI::SetWarGoal(PlayerTypes, WarGoalTypes)

Defined in
CvDiplomacyAI.cpp, line 6355
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetWarGoal

Hooks

static bool BeforeCvDiplomacyAI_SetWarGoal(CvDiplomacyAI* self, PlayerTypes ePlayer, WarGoalTypes eWarGoal);static void AfterCvDiplomacyAI_SetWarGoal(CvDiplomacyAI* self, PlayerTypes ePlayer, WarGoalTypes eWarGoal);static void ReplaceCvDiplomacyAI_SetWarGoal(void (*original)(CvDiplomacyAI*, PlayerTypes, WarGoalTypes), CvDiplomacyAI* self, PlayerTypes ePlayer, WarGoalTypes eWarGoal);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetWarGoal>(host, &BeforeCvDiplomacyAI_SetWarGoal);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetWarGoal>(host, &AfterCvDiplomacyAI_SetWarGoal);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetWarGoal>(host, &ReplaceCvDiplomacyAI_SetWarGoal);

Code

6354/// Sets what the Goal of war is with this Players6355void CvDiplomacyAI::SetWarGoal(PlayerTypes ePlayer, WarGoalTypes eWarGoal)6356{6357	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");6358	CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");6359	CvAssertMsg(eWarGoal >= NO_WAR_GOAL_TYPE, "DIPLOMACY_AI: Invalid WarGoalType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");	// NO_WAR_GOAL_TYPE is valid (if we're not at war)6360	CvAssertMsg(eWarGoal < NUM_WAR_GOALS, "DIPLOMACY_AI: Invalid WarGoalType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");63616362	//if (GetWarGoal(ePlayer) == WAR_GOAL_DEMAND && eWarGoal != WAR_GOAL_DEMAND)6363	//{6364	//	CvAssert(false);6365	//}63666367	m_paeWarGoal[ePlayer] = eWarGoal;6368}

Called by