Hooks
static bool BeforeCvUnit_disembark(CvUnit* self, CvPlot* pPlot);static void AfterCvUnit_disembark(CvUnit* self, CvPlot* pPlot);static void ReplaceCvUnit_disembark(void (*original)(CvUnit*, CvPlot*), CvUnit* self, CvPlot* pPlot);CivRegisterBefore<CivHooks::CvUnit_disembark>(host, &BeforeCvUnit_disembark);CivRegisterAfter<CivHooks::CvUnit_disembark>(host, &AfterCvUnit_disembark);CivRegisterReplace<CivHooks::CvUnit_disembark>(host, &ReplaceCvUnit_disembark);
Code
5185void CvUnit::disembark(CvPlot* pPlot)5186{5187 VALIDATE_OBJECT5188 if (canChangeVisibility())5189#if defined(MOD_API_EXTENSIONS)5190 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), false, getSeeInvisibleType(), getFacingDirection(true), this);5191#else5192 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), false, getSeeInvisibleType(), getFacingDirection(true));5193#endif51945195 setEmbarked(false);51965197 if (canChangeVisibility())5198#if defined(MOD_API_EXTENSIONS)5199 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), true, getSeeInvisibleType(), getFacingDirection(true), this);5200#else5201 pPlot->changeAdjacentSight(getTeam(), visibilityRange(), true, getSeeInvisibleType(), getFacingDirection(true));5202#endif52035204 auto_ptr<ICvUnit1> pDllUnit(new CvDllUnit(this));5205 gDLL->GameplayUnitEmbark(pDllUnit.get(), false);5206}