Bazaar developer reference

CvDiplomacyAI::SetNumWarsFought(PlayerTypes, int)

Defined in
CvDiplomacyAI.cpp, line 6547
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetNumWarsFought

Hooks

static bool BeforeCvDiplomacyAI_SetNumWarsFought(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void AfterCvDiplomacyAI_SetNumWarsFought(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void ReplaceCvDiplomacyAI_SetNumWarsFought(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetNumWarsFought>(host, &BeforeCvDiplomacyAI_SetNumWarsFought);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetNumWarsFought>(host, &AfterCvDiplomacyAI_SetNumWarsFought);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetNumWarsFought>(host, &ReplaceCvDiplomacyAI_SetNumWarsFought);

Code

6546/// How many times have we gone to war?6547void CvDiplomacyAI::SetNumWarsFought(PlayerTypes ePlayer, int iValue)6548{6549	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");6550	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.");6551	CvAssertMsg(iValue >= 0, "DIPLOMACY_AI: Setting NumWarsFought to a negative value.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");65526553	m_paiNumWarsFought[ePlayer] = iValue;6554}

Called by