InfluenceDestValid(int, int, const void *, CvAStar *)
- Defined in
- CvAStar.cpp, line 2188
- Hook name
CivHooks::InfluenceDestValid
Hooks
static bool BeforeInfluenceDestValid(int iToX, int iToY, const void* pointer, CvAStar* finder, int& result);static void AfterInfluenceDestValid(int iToX, int iToY, const void* pointer, CvAStar* finder, int& result);static int ReplaceInfluenceDestValid(int (*original)(int, int, const void*, CvAStar*), int iToX, int iToY, const void* pointer, CvAStar* finder);CivRegisterBefore<CivHooks::InfluenceDestValid>(host, &BeforeInfluenceDestValid);CivRegisterAfter<CivHooks::InfluenceDestValid>(host, &AfterInfluenceDestValid);CivRegisterReplace<CivHooks::InfluenceDestValid>(host, &ReplaceInfluenceDestValid);
Code
2187/// Influence path finder - is this end point for the path valid?2188int InfluenceDestValid(int iToX, int iToY, const void* pointer, CvAStar* finder)2189{2190 CvPlot* pFromPlot;2191 CvPlot* pToPlot;21922193 CvMap& kMap = GC.getMap();2194 pFromPlot = kMap.plotUnchecked(finder->GetStartX(), finder->GetStartY());2195 pToPlot = kMap.plotUnchecked(iToX, iToY);21962197 if(pointer)2198 {2199 int iRange = abs(*(int*)pointer);2200 if(plotDistance(pFromPlot->getX(),pFromPlot->getY(),pToPlot->getX(),pToPlot->getY()) > iRange)2201 {2202 return FALSE;2203 }2204 }22052206 return TRUE;2207}