Bazaar developer reference

CvUnit::changeExtraVisibilityRange(int)

Defined in
CvUnit.cpp, line 17845
Class
CvUnit
Hook name
CivHooks::CvUnit_changeExtraVisibilityRange

Hooks

static bool BeforeCvUnit_changeExtraVisibilityRange(CvUnit* self, int iChange);static void AfterCvUnit_changeExtraVisibilityRange(CvUnit* self, int iChange);static void ReplaceCvUnit_changeExtraVisibilityRange(void (*original)(CvUnit*, int), CvUnit* self, int iChange);CivRegisterBefore<CivHooks::CvUnit_changeExtraVisibilityRange>(host, &BeforeCvUnit_changeExtraVisibilityRange);CivRegisterAfter<CivHooks::CvUnit_changeExtraVisibilityRange>(host, &AfterCvUnit_changeExtraVisibilityRange);CivRegisterReplace<CivHooks::CvUnit_changeExtraVisibilityRange>(host, &ReplaceCvUnit_changeExtraVisibilityRange);

Code

17845void CvUnit::changeExtraVisibilityRange(int iChange)17846{17847	VALIDATE_OBJECT17848	if(iChange != 0)17849	{17850		CvPlot* pkPlot = plot();17851		if (canChangeVisibility())17852#if defined(MOD_API_EXTENSIONS)17853			pkPlot->changeAdjacentSight(getTeam(), visibilityRange(), false, getSeeInvisibleType(), getFacingDirection(true), this);17854#else17855			pkPlot->changeAdjacentSight(getTeam(), visibilityRange(), false, getSeeInvisibleType(), getFacingDirection(true));17856#endif17857		m_iExtraVisibilityRange = (m_iExtraVisibilityRange + iChange);17858		if (canChangeVisibility())17859#if defined(MOD_API_EXTENSIONS)17860			pkPlot->changeAdjacentSight(getTeam(), visibilityRange(), true, getSeeInvisibleType(), getFacingDirection(true), this);17861#else17862			pkPlot->changeAdjacentSight(getTeam(), visibilityRange(), true, getSeeInvisibleType(), getFacingDirection(true));17863#endif17864	}17865}

Calls

Called by