Bazaar developer reference

CvTacticalAI::ExecutePlunderTradeUnit(CvPlot *)

Defined in
CvTacticalAI.cpp, line 6263
Class
CvTacticalAI
Hook name
CivHooks::CvTacticalAI_ExecutePlunderTradeUnit

Hooks

static bool BeforeCvTacticalAI_ExecutePlunderTradeUnit(CvTacticalAI* self, CvPlot* pTargetPlot);static void AfterCvTacticalAI_ExecutePlunderTradeUnit(CvTacticalAI* self, CvPlot* pTargetPlot);static void ReplaceCvTacticalAI_ExecutePlunderTradeUnit(void (*original)(CvTacticalAI*, CvPlot*), CvTacticalAI* self, CvPlot* pTargetPlot);CivRegisterBefore<CivHooks::CvTacticalAI_ExecutePlunderTradeUnit>(host, &BeforeCvTacticalAI_ExecutePlunderTradeUnit);CivRegisterAfter<CivHooks::CvTacticalAI_ExecutePlunderTradeUnit>(host, &AfterCvTacticalAI_ExecutePlunderTradeUnit);CivRegisterReplace<CivHooks::CvTacticalAI_ExecutePlunderTradeUnit>(host, &ReplaceCvTacticalAI_ExecutePlunderTradeUnit);

Code

6262/// Pillage an undefended improvement6263void CvTacticalAI::ExecutePlunderTradeUnit(CvPlot* pTargetPlot)6264{6265	// Move first one to target6266	UnitHandle pUnit = m_pPlayer->getUnit(m_CurrentMoveUnits[0].GetID());6267	if(pUnit)6268	{6269		pUnit->PushMission(CvTypes::getMISSION_MOVE_TO(), pTargetPlot->getX(), pTargetPlot->getY());6270		pUnit->PushMission(CvTypes::getMISSION_PLUNDER_TRADE_ROUTE());6271		pUnit->finishMoves();62726273		// Delete this unit from those we have to move6274		UnitProcessed(m_CurrentMoveUnits[0].GetID());6275	}6276}

Calls

Called by