Bazaar developer reference

CvDiplomacyAI::DoDemandMade(PlayerTypes)

Defined in
CvDiplomacyAI.cpp, line 20700
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_DoDemandMade

Hooks

static bool BeforeCvDiplomacyAI_DoDemandMade(CvDiplomacyAI* self, PlayerTypes ePlayer);static void AfterCvDiplomacyAI_DoDemandMade(CvDiplomacyAI* self, PlayerTypes ePlayer);static void ReplaceCvDiplomacyAI_DoDemandMade(void (*original)(CvDiplomacyAI*, PlayerTypes), CvDiplomacyAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvDiplomacyAI_DoDemandMade>(host, &BeforeCvDiplomacyAI_DoDemandMade);CivRegisterAfter<CivHooks::CvDiplomacyAI_DoDemandMade>(host, &AfterCvDiplomacyAI_DoDemandMade);CivRegisterReplace<CivHooks::CvDiplomacyAI_DoDemandMade>(host, &ReplaceCvDiplomacyAI_DoDemandMade);

Code

20700void CvDiplomacyAI::DoDemandMade(PlayerTypes ePlayer)20701{20702	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");20703	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.");2070420705	// Reset counter20706	SetDemandCounter(ePlayer, 0);2070720708	// See how long it'll be before we might agree to another demand2070920710	int iNumTurns = /*20*/ GC.getDEMAND_TURN_LIMIT_MIN();20711	int iRand = GC.getGame().getJonRandNum(/*10*/ GC.getDEMAND_TURN_LIMIT_RAND(), "Diplomacy AI: Number of turns before demand can be accepted.");20712	iNumTurns += iRand;2071320714	m_paiDemandTooSoonNumTurns[ePlayer] = iNumTurns;20715}

Calls

Called by