Bazaar developer reference

CvDiplomacyAI::DoAddNewDeclarationToLog(PublicDeclarationTypes, int, int, PlayerTypes, bool)

Defined in
CvDiplomacyAI.cpp, line 25088
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoAddNewDeclarationToLog

Hooks

static bool BeforeCvDiplomacyAI_DoAddNewDeclarationToLog(CvDiplomacyAI* self, PublicDeclarationTypes eDeclaration, int iData1, int iData2, PlayerTypes eMustHaveMetPlayer, bool bActive);static void AfterCvDiplomacyAI_DoAddNewDeclarationToLog(CvDiplomacyAI* self, PublicDeclarationTypes eDeclaration, int iData1, int iData2, PlayerTypes eMustHaveMetPlayer, bool bActive);static void ReplaceCvDiplomacyAI_DoAddNewDeclarationToLog(void (*original)(CvDiplomacyAI*, PublicDeclarationTypes, int, int, PlayerTypes, bool), CvDiplomacyAI* self, PublicDeclarationTypes eDeclaration, int iData1, int iData2, PlayerTypes eMustHaveMetPlayer, bool bActive);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoAddNewDeclarationToLog>(host, &BeforeCvDiplomacyAI_DoAddNewDeclarationToLog);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoAddNewDeclarationToLog>(host, &AfterCvDiplomacyAI_DoAddNewDeclarationToLog);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoAddNewDeclarationToLog>(host, &ReplaceCvDiplomacyAI_DoAddNewDeclarationToLog);

Code

25087/// We made a public declaration, so keep a record of it25088void CvDiplomacyAI::DoAddNewDeclarationToLog(PublicDeclarationTypes eDeclaration, int iData1, int iData2, PlayerTypes eMustHaveMetPlayer, bool bActive)25089{25090	CvAssertMsg(eDeclaration >= 0, "DIPLOMACY_AI: Invalid PublicDeclarationType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");25091	CvAssertMsg(eDeclaration < NUM_PUBLIC_DECLARATION_TYPES, "DIPLOMACY_AI: Invalid PublicDeclarationType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");2509225093	// Bump current entries back so we can put the new one at index 025094	for(int iI = MAX_DIPLO_LOG_STATEMENTS - 1; iI > 0; iI--)25095	{25096		// Nothing in this entry to move?25097		if(m_paDeclarationsLog[iI-1].m_eDeclaration != NO_PUBLIC_DECLARATION_TYPE)25098		{25099			m_paDeclarationsLog[iI].m_eDeclaration = m_paDeclarationsLog[iI-1].m_eDeclaration;25100			m_paDeclarationsLog[iI].m_iData1 = m_paDeclarationsLog[iI-1].m_iData1;25101			m_paDeclarationsLog[iI].m_iData2 = m_paDeclarationsLog[iI-1].m_iData2;25102			m_paDeclarationsLog[iI].m_eMustHaveMetPlayer = m_paDeclarationsLog[iI-1].m_eMustHaveMetPlayer;25103			m_paDeclarationsLog[iI].m_bActive = m_paDeclarationsLog[iI-1].m_bActive;25104			m_paDeclarationsLog[iI].m_iTurn = m_paDeclarationsLog[iI-1].m_iTurn;25105		}25106	}2510725108	m_paDeclarationsLog[0].m_eDeclaration = eDeclaration;25109	m_paDeclarationsLog[0].m_iData1 = iData1;25110	m_paDeclarationsLog[0].m_iData2 = iData2;25111	m_paDeclarationsLog[0].m_eMustHaveMetPlayer = eMustHaveMetPlayer;25112	m_paDeclarationsLog[0].m_bActive = bActive;25113	m_paDeclarationsLog[0].m_iTurn = 0;25114}

Called by