Bazaar developer reference

CvDiplomacyAI::SetOtherPlayerWarValueLost(PlayerTypes, PlayerTypes, int)

Defined in
CvDiplomacyAI.cpp, line 9309
Class
CvDiplomacyAI
Hook name
CivHooks::CvDiplomacyAI_SetOtherPlayerWarValueLost

Hooks

static bool BeforeCvDiplomacyAI_SetOtherPlayerWarValueLost(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eLostToPlayer, int iValue);static void AfterCvDiplomacyAI_SetOtherPlayerWarValueLost(CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eLostToPlayer, int iValue);static void ReplaceCvDiplomacyAI_SetOtherPlayerWarValueLost(void (*original)(CvDiplomacyAI*, PlayerTypes, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, PlayerTypes eLostToPlayer, int iValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetOtherPlayerWarValueLost>(host, &BeforeCvDiplomacyAI_SetOtherPlayerWarValueLost);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetOtherPlayerWarValueLost>(host, &AfterCvDiplomacyAI_SetOtherPlayerWarValueLost);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetOtherPlayerWarValueLost>(host, &ReplaceCvDiplomacyAI_SetOtherPlayerWarValueLost);

Code

9308// Sets the value of stuff (Units & Cities) we estimate a player has lost in a war against a another Player9309void CvDiplomacyAI::SetOtherPlayerWarValueLost(PlayerTypes ePlayer, PlayerTypes eLostToPlayer, int iValue)9310{9311	CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9312	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.");9313	CvAssertMsg(eLostToPlayer >= 0, "DIPLOMACY_AI: Invalid Player Index.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9314	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.");9315	CvAssertMsg(iValue >= 0, "DIPLOMACY_AI: Setting OtherPlayerWarValueLost to a negative value.  Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9316	m_ppaaiOtherPlayerWarValueLost[ePlayer][eLostToPlayer] = iValue;93179318	// Reset War Damage9319	if(iValue == 0)9320		m_ppaaeOtherPlayerWarDamageLevel[ePlayer][eLostToPlayer] = WAR_DAMAGE_LEVEL_NONE;9321}

Called by