Hooks
static bool BeforeCvUnit_setSeeInvisibleType(CvUnit* self, InvisibleTypes InvisibleType);static void AfterCvUnit_setSeeInvisibleType(CvUnit* self, InvisibleTypes InvisibleType);static void ReplaceCvUnit_setSeeInvisibleType(void (*original)(CvUnit*, InvisibleTypes), CvUnit* self, InvisibleTypes InvisibleType);CivRegisterBefore<CivHooks::CvUnit_setSeeInvisibleType>(host, &BeforeCvUnit_setSeeInvisibleType);CivRegisterAfter<CivHooks::CvUnit_setSeeInvisibleType>(host, &AfterCvUnit_setSeeInvisibleType);CivRegisterReplace<CivHooks::CvUnit_setSeeInvisibleType>(host, &ReplaceCvUnit_setSeeInvisibleType);
Code
19792void CvUnit::setSeeInvisibleType(InvisibleTypes InvisibleType)19793{19794 VALIDATE_OBJECT19795 if(m_eSeeInvisibleType != InvisibleType)19796 {19797 CvPlot* pPlot = GC.getMap().plotCheckInvalid(getX(), getY());19798 if(pPlot && canChangeVisibility())19799 {19800#if defined(MOD_API_EXTENSIONS)19801 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), false, getSeeInvisibleType(), getFacingDirection(true), this);19802#else19803 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), false, getSeeInvisibleType(), getFacingDirection(true));19804#endif19805 }19806 m_eSeeInvisibleType = InvisibleType;19807 if(pPlot && canChangeVisibility())19808 {19809#if defined(MOD_API_EXTENSIONS)19810 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), true, getSeeInvisibleType(), getFacingDirection(true), this);19811#else19812 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), true, getSeeInvisibleType(), getFacingDirection(true));19813#endif19814 }19815 }19816}