CvDiplomacyAI::SetWarValueLost(PlayerTypes, int)
- Defined in
- CvDiplomacyAI.cpp, line 9153
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_SetWarValueLost
Hooks
static bool BeforeCvDiplomacyAI_SetWarValueLost(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void AfterCvDiplomacyAI_SetWarValueLost(CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);static void ReplaceCvDiplomacyAI_SetWarValueLost(void (*original)(CvDiplomacyAI*, PlayerTypes, int), CvDiplomacyAI* self, PlayerTypes ePlayer, int iValue);CivRegisterBefore<CivHooks::CvDiplomacyAI_SetWarValueLost>(host, &BeforeCvDiplomacyAI_SetWarValueLost);CivRegisterAfter<CivHooks::CvDiplomacyAI_SetWarValueLost>(host, &AfterCvDiplomacyAI_SetWarValueLost);CivRegisterReplace<CivHooks::CvDiplomacyAI_SetWarValueLost>(host, &ReplaceCvDiplomacyAI_SetWarValueLost);
Code
9152// Sets the value of stuff (Units & Cities) lost in a war against a particular Player9153void CvDiplomacyAI::SetWarValueLost(PlayerTypes ePlayer, int iValue)9154{9155 CvAssertMsg(ePlayer >= 0, "DIPLOMACY_AI: Invalid Player Index. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9156 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.");9157 CvAssertMsg(iValue >= 0, "DIPLOMACY_AI: Setting WarValueLost to a negative value. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9158 m_paiWarValueLost[ePlayer] = iValue;91599160 // Reset War Damage9161 if(iValue == 0)9162 m_paeWarDamageLevel[ePlayer] = WAR_DAMAGE_LEVEL_NONE;9163}