Bazaar developer reference

CvUnit::canChangeTradeUnitHomeCity(const CvPlot *) const

Defined in
CvUnit.cpp, line 6830
Class
CvUnit
Hook name
CivHooks::CvUnit_canChangeTradeUnitHomeCity

Hooks

static bool BeforeCvUnit_canChangeTradeUnitHomeCity(const CvUnit* self, const CvPlot* pPlot, bool& result);static void AfterCvUnit_canChangeTradeUnitHomeCity(const CvUnit* self, const CvPlot* pPlot, bool& result);static bool ReplaceCvUnit_canChangeTradeUnitHomeCity(bool (*original)(const CvUnit*, const CvPlot*), const CvUnit* self, const CvPlot* pPlot);CivRegisterBefore<CivHooks::CvUnit_canChangeTradeUnitHomeCity>(host, &BeforeCvUnit_canChangeTradeUnitHomeCity);CivRegisterAfter<CivHooks::CvUnit_canChangeTradeUnitHomeCity>(host, &AfterCvUnit_canChangeTradeUnitHomeCity);CivRegisterReplace<CivHooks::CvUnit_canChangeTradeUnitHomeCity>(host, &ReplaceCvUnit_canChangeTradeUnitHomeCity);

Code

6830bool CvUnit::canChangeTradeUnitHomeCity(const CvPlot* pPlot) const6831{6832	if (!isTrade())6833	{6834		return false;6835	}68366837	if (pPlot == NULL)6838	{6839		return false;6840	}68416842	CvCity* pCity = pPlot->getPlotCity();6843	if (pCity == NULL)6844	{6845		return false;6846	}68476848	if (pCity->getOwner() != getOwner())6849	{6850		return false;6851	}68526853	return true;6854}

Calls

Called by