CvUnit::GetPathEndTurnPlot() const
- Defined in
- CvUnit.cpp, line 24011
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_GetPathEndTurnPlot
Hooks
static bool BeforeCvUnit_GetPathEndTurnPlot(const CvUnit* self, CvPlot*& result);static void AfterCvUnit_GetPathEndTurnPlot(const CvUnit* self, CvPlot*& result);static CvPlot* ReplaceCvUnit_GetPathEndTurnPlot(CvPlot* (*original)(const CvUnit*), const CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_GetPathEndTurnPlot>(host, &BeforeCvUnit_GetPathEndTurnPlot);CivRegisterAfter<CivHooks::CvUnit_GetPathEndTurnPlot>(host, &AfterCvUnit_GetPathEndTurnPlot);CivRegisterReplace<CivHooks::CvUnit_GetPathEndTurnPlot>(host, &ReplaceCvUnit_GetPathEndTurnPlot);
Code
24010/// Where do we end this next move?24011CvPlot* CvUnit::GetPathEndTurnPlot() const24012{24013 VALIDATE_OBJECT2401424015 if(m_kLastPath.size())24016 {24017 const CvPathNode* pNode = &m_kLastPath[0];2401824019 if(m_kLastPath.size() == 1 || (pNode->m_iData2 == 1))24020 {24021 return GC.getMap().plotCheckInvalid(pNode->m_iX, pNode->m_iY);24022 }2402324024 for(uint uiIndex = 1; uiIndex < m_kLastPath.size(); ++uiIndex)24025 {24026 pNode = &m_kLastPath[uiIndex];24027 if(pNode->m_iData2 == 1)24028 {24029 return GC.getMap().plotCheckInvalid(pNode->m_iX, pNode->m_iY);24030 }24031 }24032 }2403324034 CvAssert(false);2403524036 return NULL;24037}
Calls
BaseVector::operator[]BaseVector::size- CvGlobals::getMap()
- CvMap::plotCheckInvalid(int, int) const