Bazaar developer reference

CvDiplomacyAI::SetMinorCivApproach(PlayerTypes, MinorCivApproachTypes)

Defined in
CvDiplomacyAI.cpp, line 4466
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetMinorCivApproach

Hooks

static bool BeforeCvDiplomacyAI_SetMinorCivApproach(CvDiplomacyAI* self, PlayerTypes ePlayer, MinorCivApproachTypes eApproach);static void AfterCvDiplomacyAI_SetMinorCivApproach(CvDiplomacyAI* self, PlayerTypes ePlayer, MinorCivApproachTypes eApproach);static void ReplaceCvDiplomacyAI_SetMinorCivApproach(void (*original)(CvDiplomacyAI*, PlayerTypes, MinorCivApproachTypes), CvDiplomacyAI* self, PlayerTypes ePlayer, MinorCivApproachTypes eApproach);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetMinorCivApproach>(host, &BeforeCvDiplomacyAI_SetMinorCivApproach);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetMinorCivApproach>(host, &AfterCvDiplomacyAI_SetMinorCivApproach);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetMinorCivApproach>(host, &ReplaceCvDiplomacyAI_SetMinorCivApproach);

Code

4465/// Sets what our Diplomatic approach is to a Minor Civ4466void CvDiplomacyAI::SetMinorCivApproach(PlayerTypes ePlayer, MinorCivApproachTypes eApproach)4467{4468	// Remove the Majors from here, since we're only actually storing Data for the Minors4469	PlayerTypes eMinor = (PlayerTypes)((int) ePlayer - MAX_MAJOR_CIVS);44704471	CvAssertMsg(eMinor >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");4472	CvAssertMsg(eMinor < MAX_MINOR_CIVS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");4473	CvAssertMsg(eApproach >= NO_MINOR_CIV_APPROACH, "DIPLOMACY_AI: Invalid MinorCivApproachType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");		// NO_MINOR_CIV_APPROACH is valid because we use it to reset at the start of every turn.  We have an assert to test -1 there.4474	CvAssertMsg(eApproach < NUM_MINOR_CIV_APPROACHES, "DIPLOMACY_AI: Invalid MinorCivApproachType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");44754476	m_paeMinorCivApproach[eMinor] = eApproach;4477}

Called by