CvIgnoreUnitsPathFinder::GetPathEndTurnPlot() const
- Defined in
- CvAStar.cpp, line 3155
- Class
- CvIgnoreUnitsPathFinder
- Hook name
CivHooks::CvIgnoreUnitsPathFinder_GetPathEndTurnPlot
Hooks
static bool BeforeCvIgnoreUnitsPathFinder_GetPathEndTurnPlot(const CvIgnoreUnitsPathFinder* self, CvPlot*& result);static void AfterCvIgnoreUnitsPathFinder_GetPathEndTurnPlot(const CvIgnoreUnitsPathFinder* self, CvPlot*& result);static CvPlot* ReplaceCvIgnoreUnitsPathFinder_GetPathEndTurnPlot(CvPlot* (*original)(const CvIgnoreUnitsPathFinder*), const CvIgnoreUnitsPathFinder* self);CivRegisterBefore<CivHooks::CvIgnoreUnitsPathFinder_GetPathEndTurnPlot>(host, &BeforeCvIgnoreUnitsPathFinder_GetPathEndTurnPlot);CivRegisterAfter<CivHooks::CvIgnoreUnitsPathFinder_GetPathEndTurnPlot>(host, &AfterCvIgnoreUnitsPathFinder_GetPathEndTurnPlot);CivRegisterReplace<CivHooks::CvIgnoreUnitsPathFinder_GetPathEndTurnPlot>(host, &ReplaceCvIgnoreUnitsPathFinder_GetPathEndTurnPlot);
Code
3154/// Return the furthest plot we can get to this turn that is on the path3155CvPlot* CvIgnoreUnitsPathFinder::GetPathEndTurnPlot() const3156{3157 CvAStarNode* pNode;31583159 pNode = GC.getIgnoreUnitsPathFinder().GetLastNode();31603161 if(NULL != pNode)3162 {3163 CvMap& kMap = GC.getMap();3164 if((pNode->m_pParent == NULL) || (pNode->m_iData2 == 1))3165 {3166 return kMap.plotUnchecked(pNode->m_iX, pNode->m_iY);3167 }31683169 while(pNode->m_pParent != NULL)3170 {3171 if(pNode->m_pParent->m_iData2 == 1)3172 {3173 return kMap.plotUnchecked(pNode->m_pParent->m_iX, pNode->m_pParent->m_iY);3174 }31753176 pNode = pNode->m_pParent;3177 }3178 }31793180 FAssert(false);31813182 return NULL;3183}