Bazaar developer reference

CvUnit::getTradeInfluence(const CvPlot *) const

Defined in
CvUnit.cpp, line 9360
Class
CvUnit
Hook name
CivHooks::CvUnit_getTradeInfluence

Hooks

static bool BeforeCvUnit_getTradeInfluence(const CvUnit* self, const CvPlot* pPlot, int& result);static void AfterCvUnit_getTradeInfluence(const CvUnit* self, const CvPlot* pPlot, int& result);static int ReplaceCvUnit_getTradeInfluence(int (*original)(const CvUnit*, const CvPlot*), const CvUnit* self, const CvPlot* pPlot);CivRegisterBefore<CivHooks::CvUnit_getTradeInfluence>(host, &BeforeCvUnit_getTradeInfluence);CivRegisterAfter<CivHooks::CvUnit_getTradeInfluence>(host, &AfterCvUnit_getTradeInfluence);CivRegisterReplace<CivHooks::CvUnit_getTradeInfluence>(host, &ReplaceCvUnit_getTradeInfluence);

Code

9360int CvUnit::getTradeInfluence(const CvPlot* pPlot) const9361{9362	VALIDATE_OBJECT9363	int iInf = 0;9364	if (pPlot && canTrade(pPlot))9365	{9366		PlayerTypes eMinor = pPlot->getOwner();9367		CvAssertMsg(eMinor != NO_PLAYER, "Performing a trade mission and not in city state territory. This is bad. Please send Jon this with your last 5 autosaves and what changelist # you're playing.");9368		if (eMinor != NO_PLAYER)9369		{9370			iInf = /*30*/ GC.getMINOR_FRIENDSHIP_FROM_TRADE_MISSION();9371			int iInfTimes100 = iInf * (100 + GetTradeMissionInfluenceModifier());9372			iInf = iInfTimes100 / 100;9373		}9374	}9375	return iInf;9376}

Calls

Called by