Bazaar developer reference

CvPlayer::SetUnitUpgradeCostMod(int)

Defined in
CvPlayer.cpp, line 13217
Class
CvPlayer
Hook name
CivHooks::CvPlayer_SetUnitUpgradeCostMod

Hooks

static bool BeforeCvPlayer_SetUnitUpgradeCostMod(CvPlayer* self, int iValue);static void AfterCvPlayer_SetUnitUpgradeCostMod(CvPlayer* self, int iValue);static void ReplaceCvPlayer_SetUnitUpgradeCostMod(void (*original)(CvPlayer*, int), CvPlayer* self, int iValue);CivRegisterBefore<CivHooks::CvPlayer_SetUnitUpgradeCostMod>(host, &BeforeCvPlayer_SetUnitUpgradeCostMod);CivRegisterAfter<CivHooks::CvPlayer_SetUnitUpgradeCostMod>(host, &AfterCvPlayer_SetUnitUpgradeCostMod);CivRegisterReplace<CivHooks::CvPlayer_SetUnitUpgradeCostMod>(host, &ReplaceCvPlayer_SetUnitUpgradeCostMod);

Code

13216/// Unit upgrade cost mod13217void CvPlayer::SetUnitUpgradeCostMod(int iValue)13218{13219	m_iUnitUpgradeCostMod = iValue;1322013221	if(m_iUnitUpgradeCostMod < /*-75*/ GC.getUNIT_UPGRADE_COST_DISCOUNT_MAX())13222		m_iUnitUpgradeCostMod = /*-75*/ GC.getUNIT_UPGRADE_COST_DISCOUNT_MAX();13223}

Calls

Called by