Bazaar developer reference

InfluenceValid(CvAStarNode *, CvAStarNode *, int, const void *, CvAStar *)

Defined in
CvAStar.cpp, line 2273
Hook name
CivHooks::InfluenceValid

Hooks

static bool BeforeInfluenceValid(CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder, int& result);static void AfterInfluenceValid(CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder, int& result);static int ReplaceInfluenceValid(int (*original)(CvAStarNode*, CvAStarNode*, int, const void*, CvAStar*), CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder);CivRegisterBefore<CivHooks::InfluenceValid>(host, &BeforeInfluenceValid);CivRegisterAfter<CivHooks::InfluenceValid>(host, &AfterInfluenceValid);CivRegisterReplace<CivHooks::InfluenceValid>(host, &ReplaceInfluenceValid);

Code

2272/// Influence path finder - check validity of a coordinate2273int InfluenceValid(CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder)2274{2275	CvPlot* pNewPlot;22762277	if(parent == NULL)2278	{2279		return TRUE;2280	}22812282	pNewPlot = GC.getMap().plotCheckInvalid(node->m_iX, node->m_iY);22832284	if(pNewPlot == NULL)2285	{2286		return FALSE;2287	}22882289	// todo: a check to see if we are within the theoretical influence range would be great22902291	return TRUE;2292}

Calls

Called by