Bazaar developer reference

CvAIOperationMerchantDelegation::FindBestTarget(CvUnit *, bool)

Defined in
CvAIOperation.cpp, line 3583
Class
CvAIOperationMerchantDelegation
Hook name
CivHooks::CvAIOperationMerchantDelegation_FindBestTarget
Overrides
CvAIEscortedOperation::FindBestTarget(CvUnit *, bool)

Hooks

static bool BeforeCvAIOperationMerchantDelegation_FindBestTarget(CvAIOperationMerchantDelegation* self, CvUnit* pUnit, bool bOnlySafePaths, CvPlot*& result);static void AfterCvAIOperationMerchantDelegation_FindBestTarget(CvAIOperationMerchantDelegation* self, CvUnit* pUnit, bool bOnlySafePaths, CvPlot*& result);static CvPlot* ReplaceCvAIOperationMerchantDelegation_FindBestTarget(CvPlot* (*original)(CvAIOperationMerchantDelegation*, CvUnit*, bool), CvAIOperationMerchantDelegation* self, CvUnit* pUnit, bool bOnlySafePaths);CivRegisterBefore<CivHooks::CvAIOperationMerchantDelegation_FindBestTarget>(host, &BeforeCvAIOperationMerchantDelegation_FindBestTarget);CivRegisterAfter<CivHooks::CvAIOperationMerchantDelegation_FindBestTarget>(host, &AfterCvAIOperationMerchantDelegation_FindBestTarget);CivRegisterReplace<CivHooks::CvAIOperationMerchantDelegation_FindBestTarget>(host, &ReplaceCvAIOperationMerchantDelegation_FindBestTarget);

Code

3582/// Find the plot where we want to settler3583CvPlot* CvAIOperationMerchantDelegation::FindBestTarget(CvUnit* pUnit, bool bOnlySafePaths)3584{3585	CvAssertMsg(pUnit, "pUnit cannot be null");3586	if(!pUnit)3587	{3588		return NULL;3589	}35903591	return GET_PLAYER(pUnit->getOwner()).FindBestMerchantTargetPlot(pUnit, !bOnlySafePaths /*m_bEscorted*/);3592}

Calls

Called by