Bazaar developer reference

CvAIOperationFoundCity::FindBestTarget(CvUnit *, bool)

Defined in
CvAIOperation.cpp, line 3254
Class
CvAIOperationFoundCity
Hook name
CivHooks::CvAIOperationFoundCity_FindBestTarget
Overrides
CvAIEscortedOperation::FindBestTarget(CvUnit *, bool)
Overridden by
CvAIOperationQuickColonize::FindBestTarget(CvUnit *, bool)

Hooks

static bool BeforeCvAIOperationFoundCity_FindBestTarget(CvAIOperationFoundCity* self, CvUnit* pUnit, bool bOnlySafePaths, CvPlot*& result);static void AfterCvAIOperationFoundCity_FindBestTarget(CvAIOperationFoundCity* self, CvUnit* pUnit, bool bOnlySafePaths, CvPlot*& result);static CvPlot* ReplaceCvAIOperationFoundCity_FindBestTarget(CvPlot* (*original)(CvAIOperationFoundCity*, CvUnit*, bool), CvAIOperationFoundCity* self, CvUnit* pUnit, bool bOnlySafePaths);CivRegisterBefore<CivHooks::CvAIOperationFoundCity_FindBestTarget>(host, &BeforeCvAIOperationFoundCity_FindBestTarget);CivRegisterAfter<CivHooks::CvAIOperationFoundCity_FindBestTarget>(host, &AfterCvAIOperationFoundCity_FindBestTarget);CivRegisterReplace<CivHooks::CvAIOperationFoundCity_FindBestTarget>(host, &ReplaceCvAIOperationFoundCity_FindBestTarget);

Code

3253/// Find the plot where we want to settle3254CvPlot* CvAIOperationFoundCity::FindBestTarget(CvUnit* pUnit, bool bOnlySafePaths)3255{3256	CvPlot* pResult = GET_PLAYER(m_eOwner).GetBestSettlePlot(pUnit, bOnlySafePaths /*m_bEscorted*/, m_iTargetArea);3257	if (pResult == NULL)3258	{3259		m_iTargetArea = -1;3260		pResult = GET_PLAYER(m_eOwner).GetBestSettlePlot(pUnit, bOnlySafePaths /*m_bEscorted*/, -1);3261	}3262	return pResult;3263}

Calls

Called by