Bazaar developer reference

CvDiplomacyAI::ChangeNumWarsFought(PlayerTypes, int)

Defined in
CvDiplomacyAI.cpp, line 6557
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_ChangeNumWarsFought

Hooks

static bool BeforeCvDiplomacyAI_ChangeNumWarsFought(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void AfterCvDiplomacyAI_ChangeNumWarsFought(CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);static void ReplaceCvDiplomacyAI_ChangeNumWarsFought(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iChange);CivRegisterBefore<CivHooks::CvDiplomacyAI_ChangeNumWarsFought>(host, &BeforeCvDiplomacyAI_ChangeNumWarsFought);CivRegisterAfter<CivHooks::CvDiplomacyAI_ChangeNumWarsFought>(host, &AfterCvDiplomacyAI_ChangeNumWarsFought);CivRegisterReplace<CivHooks::CvDiplomacyAI_ChangeNumWarsFought>(host, &ReplaceCvDiplomacyAI_ChangeNumWarsFought);

Code

6556/// How many times have we gone to war?6557void CvDiplomacyAI::ChangeNumWarsFought(PlayerTypes ePlayer, int iChange)6558{6559	if(iChange != 0)6560	{6561		SetNumWarsFought(ePlayer, GetNumWarsFought(ePlayer) + iChange);6562	}6563}

Calls

Called by