Bazaar developer reference

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

Defined in
CvAStar.cpp, line 3312
Hook name
CivHooks::AttackPathAdd

Hooks

static bool BeforeAttackPathAdd(CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder, int& result);static void AfterAttackPathAdd(CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder, int& result);static int ReplaceAttackPathAdd(int (*original)(CvAStarNode*, CvAStarNode*, int, const void*, CvAStar*), CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder);CivRegisterBefore<CivHooks::AttackPathAdd>(host, &BeforeAttackPathAdd);CivRegisterAfter<CivHooks::AttackPathAdd>(host, &AfterAttackPathAdd);CivRegisterReplace<CivHooks::AttackPathAdd>(host, &ReplaceAttackPathAdd);

Code

3312int AttackPathAdd(CvAStarNode* parent, CvAStarNode* node, int data, const void* pointer, CvAStar* finder)3313{3314	PathAdd(parent, node, data, pointer, finder);3315	if(node && node->m_iData2 < 2)3316	{3317		CvPlot* pPlot = GC.getMap().plot(node->m_iX, node->m_iY);33183319		auto_ptr<ICvUnit1> pDllUnit(GC.GetEngineUserInterface()->GetHeadSelectedUnit());3320		CvUnit* pUnit = GC.UnwrapUnitPointer(pDllUnit.get());3321		CvAssertMsg(pUnit, "pUnit should be a value");33223323		if(pUnit && pPlot)3324		{3325			if(pPlot->isVisible(pUnit->getTeam()) && (pPlot->isVisibleEnemyUnit(pUnit) || pPlot->isEnemyCity(*pUnit)))3326			{3327				auto_ptr<ICvPlot1> pDllPlot = GC.WrapPlotPointer(pPlot);3328				GC.GetEngineUserInterface()->AddHexToUIRange(pDllPlot.get());3329			}3330		}3331	}33323333	return 1;3334}

Calls

Called by