Bazaar developer reference

CvGameTrade::RecallUnit(int, bool)

Defined in
CvTradeClasses.cpp, line 1415
Class
CvGameTrade
Hook name
CivHooks::CvGameTrade_RecallUnit

Hooks

static bool BeforeCvGameTrade_RecallUnit(CvGameTrade* self, int iIndex, bool bImmediate);static void AfterCvGameTrade_RecallUnit(CvGameTrade* self, int iIndex, bool bImmediate);static void ReplaceCvGameTrade_RecallUnit(void (*original)(CvGameTrade*, int, bool), CvGameTrade* self, int iIndex, bool bImmediate);CivRegisterBefore<CivHooks::CvGameTrade_RecallUnit>(host, &BeforeCvGameTrade_RecallUnit);CivRegisterAfter<CivHooks::CvGameTrade_RecallUnit>(host, &AfterCvGameTrade_RecallUnit);CivRegisterReplace<CivHooks::CvGameTrade_RecallUnit>(host, &ReplaceCvGameTrade_RecallUnit);

Code

1414/// recall a trade unit1415void CvGameTrade::RecallUnit (int iIndex, bool bImmediate) {1416	CvAssertMsg(iIndex >= 0 && iIndex < (int)m_aTradeConnections.size(), "iIndex out of bounds");1417	if (iIndex < 0 || iIndex >= (int)m_aTradeConnections.size())1418	{1419		return;1420	}14211422	TradeConnection &kTradeConnection = m_aTradeConnections[iIndex];1423	kTradeConnection.m_iCircuitsCompleted = kTradeConnection.m_iCircuitsToComplete-1;1424	kTradeConnection.m_bTradeUnitRecalled = true;14251426	if (bImmediate) {1427		kTradeConnection.m_bTradeUnitMovingForward = false;1428	}1429}

Calls

Called by