Bazaar developer reference

CvAIOperation::SelectInitialMusterPoint(CvArmyAI *)

Defined in
CvAIOperation.cpp, line 1527
Class
CvAIOperation
Hook name
CivHooks::CvAIOperation_SelectInitialMusterPoint
Overridden by
CvAIEnemyTerritoryOperation::SelectInitialMusterPoint(CvArmyAI *)

Hooks

static bool BeforeCvAIOperation_SelectInitialMusterPoint(CvAIOperation* self, CvArmyAI* pThisArmy, CvPlot*& result);static void AfterCvAIOperation_SelectInitialMusterPoint(CvAIOperation* self, CvArmyAI* pThisArmy, CvPlot*& result);static CvPlot* ReplaceCvAIOperation_SelectInitialMusterPoint(CvPlot* (*original)(CvAIOperation*, CvArmyAI*), CvAIOperation* self, CvArmyAI* pThisArmy);CivRegisterBefore<CivHooks::CvAIOperation_SelectInitialMusterPoint>(host, &BeforeCvAIOperation_SelectInitialMusterPoint);CivRegisterAfter<CivHooks::CvAIOperation_SelectInitialMusterPoint>(host, &AfterCvAIOperation_SelectInitialMusterPoint);CivRegisterReplace<CivHooks::CvAIOperation_SelectInitialMusterPoint>(host, &ReplaceCvAIOperation_SelectInitialMusterPoint);

Code

1526/// Figure out the initial rally point1527CvPlot* CvAIOperation::SelectInitialMusterPoint(CvArmyAI* pThisArmy)1528{1529	CvPlot* pMusterPt = NULL;1530	CvPlot* pStartCityPlot;1531	CvCity* pStartCity;15321533	pStartCity = GetOperationStartCity();1534	if(pStartCity)1535	{1536		pStartCityPlot = pStartCity->plot();15371538		if(pStartCityPlot != NULL)1539		{1540			// Generate a step path from our start to the target1541			pMusterPt = GC.getStepFinder().GetLastOwnedPlot(GetOwner(), GetEnemy(), pStartCityPlot, pThisArmy->GetGoalPlot());15421543			// Should find a space we own1544			if(pMusterPt == NULL)1545			{1546				return NULL;1547			}1548			else1549			{1550				SetMusterPlot(pMusterPt);1551			}1552		}1553	}15541555	return pMusterPt;1556}

Calls