Hooks
static bool BeforeCvUnit_setReconPlot(CvUnit* self, CvPlot* pNewValue);static void AfterCvUnit_setReconPlot(CvUnit* self, CvPlot* pNewValue);static void ReplaceCvUnit_setReconPlot(void (*original)(CvUnit*, CvPlot*), CvUnit* self, CvPlot* pNewValue);CivRegisterBefore<CivHooks::CvUnit_setReconPlot>(host, &BeforeCvUnit_setReconPlot);CivRegisterAfter<CivHooks::CvUnit_setReconPlot>(host, &AfterCvUnit_setReconPlot);CivRegisterReplace<CivHooks::CvUnit_setReconPlot>(host, &ReplaceCvUnit_setReconPlot);
Code
16553void CvUnit::setReconPlot(CvPlot* pNewValue)16554{16555 VALIDATE_OBJECT16556 CvPlot* pOldPlot;1655716558 pOldPlot = getReconPlot();1655916560 if(pOldPlot != pNewValue)16561 {16562 if(pOldPlot != NULL)16563 {16564 if (canChangeVisibility())16565#if defined(MOD_PROMOTIONS_VARIABLE_RECON)16566#if defined(MOD_API_EXTENSIONS)16567 pOldPlot->changeAdjacentSight(getTeam(), reconRange(), false, getSeeInvisibleType(), getFacingDirection(true), this);16568#else16569 pOldPlot->changeAdjacentSight(getTeam(), reconRange(), false, getSeeInvisibleType(), getFacingDirection(true));16570#endif16571#else16572#if defined(MOD_API_EXTENSIONS)16573 pOldPlot->changeAdjacentSight(getTeam(), GC.getRECON_VISIBILITY_RANGE(), false, getSeeInvisibleType(), getFacingDirection(true), *this);16574#else16575 pOldPlot->changeAdjacentSight(getTeam(), GC.getRECON_VISIBILITY_RANGE(), false, getSeeInvisibleType(), getFacingDirection(true));16576#endif16577#endif16578 pOldPlot->changeReconCount(-1); // changeAdjacentSight() tests for getReconCount()16579 }1658016581 if(pNewValue == NULL)16582 {16583 m_iReconX = INVALID_PLOT_COORD;16584 m_iReconY = INVALID_PLOT_COORD;16585 }16586 else16587 {16588 m_iReconX = pNewValue->getX();16589 m_iReconY = pNewValue->getY();1659016591 pNewValue->changeReconCount(1); // changeAdjacentSight() tests for getReconCount()16592 if (canChangeVisibility())16593#if defined(MOD_PROMOTIONS_VARIABLE_RECON)16594#if defined(MOD_API_EXTENSIONS)16595 pNewValue->changeAdjacentSight(getTeam(), reconRange(), true, getSeeInvisibleType(), getFacingDirection(true), this);16596#else16597 pNewValue->changeAdjacentSight(getTeam(), reconRange(), true, getSeeInvisibleType(), getFacingDirection(true));16598#endif16599#else16600#if defined(MOD_API_EXTENSIONS)16601 pNewValue->changeAdjacentSight(getTeam(), GC.getRECON_VISIBILITY_RANGE(), true, getSeeInvisibleType(), getFacingDirection(true), *this);16602#else16603 pNewValue->changeAdjacentSight(getTeam(), GC.getRECON_VISIBILITY_RANGE(), true, getSeeInvisibleType(), getFacingDirection(true));16604#endif16605#endif16606 }16607 }16608}