Hooks
static bool BeforeCvPlot_changeSeeFromSight(CvPlot* self, TeamTypes eTeam, DirectionTypes eDirection, int iFromLevel, bool bIncrement, InvisibleTypes eSeeInvisible, CvUnit* pUnit);static void AfterCvPlot_changeSeeFromSight(CvPlot* self, TeamTypes eTeam, DirectionTypes eDirection, int iFromLevel, bool bIncrement, InvisibleTypes eSeeInvisible, CvUnit* pUnit);static void ReplaceCvPlot_changeSeeFromSight(void (*original)(CvPlot*, TeamTypes, DirectionTypes, int, bool, InvisibleTypes, CvUnit*), CvPlot* self, TeamTypes eTeam, DirectionTypes eDirection, int iFromLevel, bool bIncrement, InvisibleTypes eSeeInvisible, CvUnit* pUnit);CivRegisterBefore<CivHooks::CvPlot_changeSeeFromSight>(host, &BeforeCvPlot_changeSeeFromSight);CivRegisterAfter<CivHooks::CvPlot_changeSeeFromSight>(host, &AfterCvPlot_changeSeeFromSight);CivRegisterReplace<CivHooks::CvPlot_changeSeeFromSight>(host, &ReplaceCvPlot_changeSeeFromSight);
Code
1497#if defined(MOD_API_EXTENSIONS)1498void CvPlot::changeSeeFromSight(TeamTypes eTeam, DirectionTypes eDirection, int iFromLevel, bool bIncrement, InvisibleTypes eSeeInvisible, CvUnit* pUnit)1499#else1500void CvPlot::changeSeeFromSight(TeamTypes eTeam, DirectionTypes eDirection, int iFromLevel, bool bIncrement, InvisibleTypes eSeeInvisible)1501#endif1502{1503 CvPlot* pPlot;1504 int iThroughLevel;15051506 iThroughLevel = seeThroughLevel();15071508 if(iFromLevel >= iThroughLevel)1509 {1510 pPlot = plotDirection(getX(), getY(), eDirection);15111512 if(pPlot != NULL)1513 {1514 if((iFromLevel > iThroughLevel) || (pPlot->seeFromLevel(eTeam) > iFromLevel))1515 {1516#if defined(MOD_API_EXTENSIONS)1517 pPlot->changeVisibilityCount(eTeam, ((bIncrement) ? 1 : -1), eSeeInvisible, true, false, pUnit);1518#else1519 pPlot->changeVisibilityCount(eTeam, ((bIncrement) ? 1 : -1), eSeeInvisible, true, false);1520#endif1521 }1522 }1523 }1524}