Bazaar developer reference

CvDiplomacyAI::SetOtherPlayerNumMajorsAttacked(PlayerTypes, int)

Defined in
CvDiplomacyAI.cpp, line 10222
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetOtherPlayerNumMajorsAttacked

Hooks

static bool BeforeCvDiplomacyAI_SetOtherPlayerNumMajorsAttacked(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void AfterCvDiplomacyAI_SetOtherPlayerNumMajorsAttacked(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void ReplaceCvDiplomacyAI_SetOtherPlayerNumMajorsAttacked(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetOtherPlayerNumMajorsAttacked>(host, &BeforeCvDiplomacyAI_SetOtherPlayerNumMajorsAttacked);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetOtherPlayerNumMajorsAttacked>(host, &AfterCvDiplomacyAI_SetOtherPlayerNumMajorsAttacked);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetOtherPlayerNumMajorsAttacked>(host, &ReplaceCvDiplomacyAI_SetOtherPlayerNumMajorsAttacked);

Code

10221/// Sets how many Majors have we seen this Player attack10222void CvDiplomacyAI::SetOtherPlayerNumMajorsAttacked(PlayerTypes ePlayer, int iValue)10223{10224	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");10225	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.");10226	CvAssertMsg(iValue >= 0, "DIPLOMACY_AI: Setting number of Majors attacked to a negative value.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");10227	m_paiOtherPlayerNumMajorsAttacked[ePlayer] = iValue;10228}

Called by