Bazaar developer reference

CvIgnoreUnitsPathFinder::GetPathFirstPlot() const

Defined in
CvAStar.cpp, line 3126
Class
CvIgnoreUnitsPathFinder
Hook name
CivHooks::CvIgnoreUnitsPathFinder_GetPathFirstPlot

Hooks

static bool BeforeCvIgnoreUnitsPathFinder_GetPathFirstPlot(const CvIgnoreUnitsPathFinder* self, CvPlot*& result);static void AfterCvIgnoreUnitsPathFinder_GetPathFirstPlot(const CvIgnoreUnitsPathFinder* self, CvPlot*& result);static CvPlot* ReplaceCvIgnoreUnitsPathFinder_GetPathFirstPlot(CvPlot* (*original)(const CvIgnoreUnitsPathFinder*), const CvIgnoreUnitsPathFinder* self);CivRegisterBefore<CivHooks::CvIgnoreUnitsPathFinder_GetPathFirstPlot>(host, &BeforeCvIgnoreUnitsPathFinder_GetPathFirstPlot);CivRegisterAfter<CivHooks::CvIgnoreUnitsPathFinder_GetPathFirstPlot>(host, &AfterCvIgnoreUnitsPathFinder_GetPathFirstPlot);CivRegisterReplace<CivHooks::CvIgnoreUnitsPathFinder_GetPathFirstPlot>(host, &ReplaceCvIgnoreUnitsPathFinder_GetPathFirstPlot);

Code

3125/// Retrieve first node of path3126CvPlot* CvIgnoreUnitsPathFinder::GetPathFirstPlot() const3127{3128	CvAStarNode* pNode;31293130	pNode = GC.getIgnoreUnitsPathFinder().GetLastNode();31313132	CvMap& kMap = GC.getMap();3133	if(pNode->m_pParent == NULL)3134	{3135		return kMap.plotUnchecked(pNode->m_iX, pNode->m_iY);3136	}31373138	while(pNode != NULL)3139	{3140		if(pNode->m_pParent->m_pParent == NULL)3141		{3142			return kMap.plotUnchecked(pNode->m_iX, pNode->m_iY);3143		}31443145		pNode = pNode->m_pParent;3146	}31473148	FAssert(false);31493150	return NULL;3151}

Calls