Bazaar developer reference

PathHeuristic(int, int, int, int)

Defined in
CvAStar.cpp, line 964
Hook name
CivHooks::PathHeuristic

Hooks

static bool BeforePathHeuristic(int iFromX, int iFromY, int iToX, int iToY, int& result);static void AfterPathHeuristic(int iFromX, int iFromY, int iToX, int iToY, int& result);static int ReplacePathHeuristic(int (*original)(int, int, int, int), int iFromX, int iFromY, int iToX, int iToY);CivRegisterBefore<CivHooks::PathHeuristic>(host, &BeforePathHeuristic);CivRegisterAfter<CivHooks::PathHeuristic>(host, &AfterPathHeuristic);CivRegisterReplace<CivHooks::PathHeuristic>(host, &ReplacePathHeuristic);

Code

963/// Standard path finder - determine heuristic cost964int PathHeuristic(int iFromX, int iFromY, int iToX, int iToY)965{966	return (plotDistance(iFromX, iFromY, iToX, iToY) * PATH_MOVEMENT_WEIGHT);967}

Calls

Called by