Bazaar developer reference

CvUnit::changeUpgradeDiscount(int)

Defined in
CvUnit.cpp, line 19317
Class
CvUnit
Hook name
CivHooks::CvUnit_changeUpgradeDiscount

Hooks

static bool BeforeCvUnit_changeUpgradeDiscount(CvUnit* self, int iChange);static void AfterCvUnit_changeUpgradeDiscount(CvUnit* self, int iChange);static void ReplaceCvUnit_changeUpgradeDiscount(void (*original)(CvUnit*, int), CvUnit* self, int iChange);CivRegisterBefore<CivHooks::CvUnit_changeUpgradeDiscount>(host, &BeforeCvUnit_changeUpgradeDiscount);CivRegisterAfter<CivHooks::CvUnit_changeUpgradeDiscount>(host, &AfterCvUnit_changeUpgradeDiscount);CivRegisterReplace<CivHooks::CvUnit_changeUpgradeDiscount>(host, &ReplaceCvUnit_changeUpgradeDiscount);

Code

19317void CvUnit::changeUpgradeDiscount(int iChange)19318{19319	VALIDATE_OBJECT19320	if(iChange != 0)19321	{19322		m_iUpgradeDiscount += iChange;1932319324		setInfoBarDirty(true);19325	}19326}

Calls

Called by