Bazaar developer reference

CvStepPathFinder::DoesPathExist(PlayerTypes, PlayerTypes, CvPlot *, CvPlot *)

Defined in
CvAStar.cpp, line 2961
Class
CvStepPathFinder
Hook name
CivHooks::CvStepPathFinder_DoesPathExist

Hooks

static bool BeforeCvStepPathFinder_DoesPathExist(CvStepPathFinder* self, PlayerTypes ePlayer, PlayerTypes eEnemy, CvPlot* pStartPlot, CvPlot* pEndPlot, bool& result);static void AfterCvStepPathFinder_DoesPathExist(CvStepPathFinder* self, PlayerTypes ePlayer, PlayerTypes eEnemy, CvPlot* pStartPlot, CvPlot* pEndPlot, bool& result);static bool ReplaceCvStepPathFinder_DoesPathExist(bool (*original)(CvStepPathFinder*, PlayerTypes, PlayerTypes, CvPlot*, CvPlot*), CvStepPathFinder* self, PlayerTypes ePlayer, PlayerTypes eEnemy, CvPlot* pStartPlot, CvPlot* pEndPlot);CivRegisterBefore<CivHooks::CvStepPathFinder_DoesPathExist>(host, &BeforeCvStepPathFinder_DoesPathExist);CivRegisterAfter<CivHooks::CvStepPathFinder_DoesPathExist>(host, &AfterCvStepPathFinder_DoesPathExist);CivRegisterReplace<CivHooks::CvStepPathFinder_DoesPathExist>(host, &ReplaceCvStepPathFinder_DoesPathExist);

Code

2960/// Check for existence of step path between two points2961bool CvStepPathFinder::DoesPathExist(PlayerTypes ePlayer, PlayerTypes eEnemy, CvPlot* pStartPlot, CvPlot* pEndPlot)2962{2963	if(pStartPlot == NULL || pEndPlot == NULL || pStartPlot->getArea() != pEndPlot->getArea())2964	{2965		return false;2966	}29672968	SetData(&eEnemy);2969	return GeneratePath(pStartPlot->getX(), pStartPlot->getY(), pEndPlot->getX(), pEndPlot->getY(), ePlayer, false);2970}

Calls

Called by