Bazaar developer reference

CvHomelandAI::PlotMerchantMoves()

Defined in
CvHomelandAI.cpp, line 1899
Class
CvHomelandAI
Hook name
CivHooks::CvHomelandAI_PlotMerchantMoves

Hooks

static bool BeforeCvHomelandAI_PlotMerchantMoves(CvHomelandAI* self);static void AfterCvHomelandAI_PlotMerchantMoves(CvHomelandAI* self);static void ReplaceCvHomelandAI_PlotMerchantMoves(void (*original)(CvHomelandAI*), CvHomelandAI* self);CivRegisterBefore<CivHooks::CvHomelandAI_PlotMerchantMoves>(host, &BeforeCvHomelandAI_PlotMerchantMoves);CivRegisterAfter<CivHooks::CvHomelandAI_PlotMerchantMoves>(host, &AfterCvHomelandAI_PlotMerchantMoves);CivRegisterReplace<CivHooks::CvHomelandAI_PlotMerchantMoves>(host, &ReplaceCvHomelandAI_PlotMerchantMoves);

Code

1898/// Find moves for great merchants1899void CvHomelandAI::PlotMerchantMoves()1900{1901	ClearCurrentMoveUnits();19021903	// Loop through all recruited units1904	for(list<int>::iterator it = m_CurrentTurnUnits.begin(); it != m_CurrentTurnUnits.end(); ++it)1905	{1906		UnitHandle pUnit = m_pPlayer->getUnit(*it);1907		if(pUnit)1908		{1909			if(pUnit->AI_getUnitAIType() == UNITAI_MERCHANT)1910			{1911				CvHomelandUnit unit;1912				unit.SetID(pUnit->GetID());1913				m_CurrentMoveUnits.push_back(unit);1914			}1915		}1916	}19171918	if(m_CurrentMoveUnits.size() > 0)1919	{1920		ExecuteMerchantMoves();1921	}1922}

Calls

Called by