Bazaar developer reference

CvDiplomacyAI::SetOtherPlayerWarDamageLevel(PlayerTypes, PlayerTypes, WarDamageLevelTypes)

Defined in
CvDiplomacyAI.cpp, line 9203
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetOtherPlayerWarDamageLevel

Hooks

static bool BeforeCvDiplomacyAI_SetOtherPlayerWarDamageLevel(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eLostToPlayer, WarDamageLevelTypes eDamageLevel);static void AfterCvDiplomacyAI_SetOtherPlayerWarDamageLevel(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eLostToPlayer, WarDamageLevelTypes eDamageLevel);static void ReplaceCvDiplomacyAI_SetOtherPlayerWarDamageLevel(void (*original)(CvDiplomacyAI*, PlayerTypes, PlayerTypes, WarDamageLevelTypes), CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eLostToPlayer, WarDamageLevelTypes eDamageLevel);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetOtherPlayerWarDamageLevel>(host, &BeforeCvDiplomacyAI_SetOtherPlayerWarDamageLevel);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetOtherPlayerWarDamageLevel>(host, &AfterCvDiplomacyAI_SetOtherPlayerWarDamageLevel);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetOtherPlayerWarDamageLevel>(host, &ReplaceCvDiplomacyAI_SetOtherPlayerWarDamageLevel);

Code

9202/// Set how much damage we think players we know have suffered in war against other players9203void CvDiplomacyAI::SetOtherPlayerWarDamageLevel(PlayerTypes ePlayer, PlayerTypes eLostToPlayer, WarDamageLevelTypes eDamageLevel)9204{9205	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9206	CvAssertMsg(ePlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9207	CvAssertMsg(eLostToPlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9208	CvAssertMsg(eLostToPlayer < MAX_CIV_PLAYERS, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9209	CvAssertMsg(eDamageLevel >= 0, "DIPLOMACY_AI: Invalid WarDamageLevelType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9210	CvAssertMsg(eDamageLevel < NUM_WAR_DAMAGE_LEVEL_TYPES, "DIPLOMACY_AI: Invalid WarDamageLevelType.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9211	m_ppaaeOtherPlayerWarDamageLevel[ePlayer][eLostToPlayer] = eDamageLevel;9212}

Called by