Bazaar developer reference

CvDiplomacyAI::SetWarmongerThreat(PlayerTypes, ThreatTypes)

Defined in
CvDiplomacyAI.cpp, line 7286
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetWarmongerThreat

Hooks

static bool BeforeCvDiplomacyAI_SetWarmongerThreat(CvDiplomacyAI* self, PlayerTypes ePlayer, ThreatTypes eWarmongerThreat);static void AfterCvDiplomacyAI_SetWarmongerThreat(CvDiplomacyAI* self, PlayerTypes ePlayer, ThreatTypes eWarmongerThreat);static void ReplaceCvDiplomacyAI_SetWarmongerThreat(void (*original)(CvDiplomacyAI*, PlayerTypes, ThreatTypes), CvDiplomacyAI* self, PlayerTypes ePlayer, ThreatTypes eWarmongerThreat);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetWarmongerThreat>(host, &BeforeCvDiplomacyAI_SetWarmongerThreat);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetWarmongerThreat>(host, &AfterCvDiplomacyAI_SetWarmongerThreat);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetWarmongerThreat>(host, &ReplaceCvDiplomacyAI_SetWarmongerThreat);

Code

7285/// Sets how much of a threat are these guys to run amok and break everything7286void CvDiplomacyAI::SetWarmongerThreat(PlayerTypes ePlayer, ThreatTypes eWarmongerThreat)7287{7288	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");7289	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");7290	CvAssertMsg(eWarmongerThreat >= 0, "DIPLOMACY_AI: Invalid ThreatType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");7291	CvAssertMsg(eWarmongerThreat < NUM_THREAT_VALUES, "DIPLOMACY_AI: Invalid ThreatType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");7292	m_paeWarmongerThreat[ePlayer] = eWarmongerThreat;7293}

Called by