Bazaar developer reference

CvDiplomacyAI::DoCancelWantsResearchAgreementWithPlayer(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 7513
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer

Hooks

static bool BeforeCvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer>(host, &BeforeCvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer>(host, &AfterCvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer>(host, &ReplaceCvDiplomacyAI_DoCancelWantsResearchAgreementWithPlayer);

Code

7512/// AI wants to cancel a Research Agreement with ePlayer, so handle everything that means7513void CvDiplomacyAI::DoCancelWantsResearchAgreementWithPlayer(PlayerTypes ePlayer)7514{7515	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");7516	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.");75177518	CvAssertMsg(IsWantsResearchAgreementWithPlayer(ePlayer), "DIPLOMACY_AI: AI trying to cancel saving for a Research Agreements he doesn't have.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.")75197520	SetWantsResearchAgreementWithPlayer(ePlayer, false);75217522	GetPlayer()->GetEconomicAI()->CancelSaveForPurchase(PURCHASE_TYPE_MAJOR_CIV_TRADE);7523}

Calls

Called by