Bazaar developer reference

CvIgnoreUnitsPathFinder::GetPathLength()

Defined in
CvAStar.cpp, line 3079
Class
CvIgnoreUnitsPathFinder
Hook name
CivHooks::CvIgnoreUnitsPathFinder_GetPathLength

Hooks

static bool BeforeCvIgnoreUnitsPathFinder_GetPathLength(CvIgnoreUnitsPathFinder* self, int& result);static void AfterCvIgnoreUnitsPathFinder_GetPathLength(CvIgnoreUnitsPathFinder* self, int& result);static int ReplaceCvIgnoreUnitsPathFinder_GetPathLength(int (*original)(CvIgnoreUnitsPathFinder*), CvIgnoreUnitsPathFinder* self);CivRegisterBefore<CivHooks::CvIgnoreUnitsPathFinder_GetPathLength>(host, &BeforeCvIgnoreUnitsPathFinder_GetPathLength);CivRegisterAfter<CivHooks::CvIgnoreUnitsPathFinder_GetPathLength>(host, &AfterCvIgnoreUnitsPathFinder_GetPathLength);CivRegisterReplace<CivHooks::CvIgnoreUnitsPathFinder_GetPathLength>(host, &ReplaceCvIgnoreUnitsPathFinder_GetPathLength);

Code

3078/// Get length of last path computed by path finder in turns [should be used after a call to DoesPathExist()]3079int CvIgnoreUnitsPathFinder::GetPathLength()3080{3081	int iPathDistance = MAX_INT;30823083	CvAStarNode* pNode = GetLastNode();3084	if(pNode != NULL)3085	{3086		iPathDistance = pNode->m_iData2;3087	}30883089	return iPathDistance;3090}

Calls

Called by