Bazaar developer reference

CvCity::changeFreePromotionCount(PromotionTypes, int)

Defined in
CvCity.cpp, line 11680
Class
CvCity
Hook name
CivHooks::CvCity_changeFreePromotionCount

Hooks

static bool BeforeCvCity_changeFreePromotionCount(CvCity* self, PromotionTypes eIndex, int iChange);static void AfterCvCity_changeFreePromotionCount(CvCity* self, PromotionTypes eIndex, int iChange);static void ReplaceCvCity_changeFreePromotionCount(void (*original)(CvCity*, PromotionTypes, int), CvCity* self, PromotionTypes eIndex, int iChange);CivRegisterBefore<CivHooks::CvCity_changeFreePromotionCount>(host, &BeforeCvCity_changeFreePromotionCount);CivRegisterAfter<CivHooks::CvCity_changeFreePromotionCount>(host, &AfterCvCity_changeFreePromotionCount);CivRegisterReplace<CivHooks::CvCity_changeFreePromotionCount>(host, &ReplaceCvCity_changeFreePromotionCount);

Code

11680void CvCity::changeFreePromotionCount(PromotionTypes eIndex, int iChange)11681{11682	VALIDATE_OBJECT11683	CvAssertMsg(eIndex >= 0, "eIndex expected to be >= 0");11684	CvAssertMsg(eIndex < GC.getNumPromotionInfos(), "eIndex expected to be < GC.getNumPromotionInfos()");11685	m_paiFreePromotionCount.setAt(eIndex, m_paiFreePromotionCount[eIndex] + iChange);11686	CvAssert(getFreePromotionCount(eIndex) >= 0);11687}

Calls

Called by