Bazaar developer reference

CvUnit::changeFeatureImpassableCount(FeatureTypes, int)

Defined in
CvUnit.cpp, line 20369
Class
CvUnit
Hook name
CivHooks::CvUnit_changeFeatureImpassableCount

Hooks

static bool BeforeCvUnit_changeFeatureImpassableCount(CvUnit* self, FeatureTypes eIndex, int iChange);static void AfterCvUnit_changeFeatureImpassableCount(CvUnit* self, FeatureTypes eIndex, int iChange);static void ReplaceCvUnit_changeFeatureImpassableCount(void (*original)(CvUnit*, FeatureTypes, int), CvUnit* self, FeatureTypes eIndex, int iChange);CivRegisterBefore<CivHooks::CvUnit_changeFeatureImpassableCount>(host, &BeforeCvUnit_changeFeatureImpassableCount);CivRegisterAfter<CivHooks::CvUnit_changeFeatureImpassableCount>(host, &AfterCvUnit_changeFeatureImpassableCount);CivRegisterReplace<CivHooks::CvUnit_changeFeatureImpassableCount>(host, &ReplaceCvUnit_changeFeatureImpassableCount);

Code

20369void CvUnit::changeFeatureImpassableCount(FeatureTypes eIndex, int iChange)20370{20371	VALIDATE_OBJECT20372	CvAssertMsg(eIndex >= 0, "eIndex is expected to be non-negative (invalid Index)");20373	CvAssertMsg(eIndex < GC.getNumFeatureInfos(), "eIndex is expected to be within maximum bounds (invalid Index)");20374	m_featureImpassableCount.setAt(eIndex, m_featureImpassableCount[eIndex] + iChange);20375	CvAssert(getFeatureImpassableCount(eIndex) >= 0);20376}

Calls

Called by