CvDeal::ChangeThirdPartyPeaceDuration(PlayerTypes, TeamTypes, int)
- Defined in
- CvDealClasses.cpp, line 1826
- Class
- CvDeal
- Hook name
CivHooks::CvDeal_ChangeThirdPartyPeaceDuration
Hooks
static bool BeforeCvDeal_ChangeThirdPartyPeaceDuration(CvDeal* self, PlayerTypes eFrom, TeamTypes eThirdPartyTeam, int iNewDuration);static void AfterCvDeal_ChangeThirdPartyPeaceDuration(CvDeal* self, PlayerTypes eFrom, TeamTypes eThirdPartyTeam, int iNewDuration);static void ReplaceCvDeal_ChangeThirdPartyPeaceDuration(void (*original)(CvDeal*, PlayerTypes, TeamTypes, int), CvDeal* self, PlayerTypes eFrom, TeamTypes eThirdPartyTeam, int iNewDuration);CivRegisterBefore<CivHooks::CvDeal_ChangeThirdPartyPeaceDuration>(host, &BeforeCvDeal_ChangeThirdPartyPeaceDuration);CivRegisterAfter<CivHooks::CvDeal_ChangeThirdPartyPeaceDuration>(host, &AfterCvDeal_ChangeThirdPartyPeaceDuration);CivRegisterReplace<CivHooks::CvDeal_ChangeThirdPartyPeaceDuration>(host, &ReplaceCvDeal_ChangeThirdPartyPeaceDuration);
Code
1826void CvDeal::ChangeThirdPartyPeaceDuration(PlayerTypes eFrom, TeamTypes eThirdPartyTeam, int iNewDuration)1827{1828 CvAssertMsg(iNewDuration >= 0, "DEAL: Trying to add a negative duration to a TradeItem. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");1829 CvAssertMsg(iNewDuration < GC.getGame().getEstimateEndTurn() * 2, "DEAL: Trade item has a crazy long duration (probably invalid). Please send Jon this with your last 5 autosaves and what changelist # you're playing.");18301831 TradedItemList::iterator it;1832 for(it = m_TradedItems.begin(); it != m_TradedItems.end(); ++it)1833 {1834 if(it->m_eItemType == TRADE_ITEM_THIRD_PARTY_PEACE &&1835 (TeamTypes)it->m_iData1 == eThirdPartyTeam &&1836 (PlayerTypes)it->m_eFromPlayer == eFrom)1837 {1838 it->m_iDuration = iNewDuration;1839 break;1840 }1841 }1842}
Calls
FCustomList_Core::base_iterator::operator++FFastList::iterator::iteratorFFastList::iterator::operator->