CvUnit::canMakeTradeRoute(const CvPlot *) const
- Defined in
- CvUnit.cpp, line 6721
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_canMakeTradeRoute
Hooks
static bool BeforeCvUnit_canMakeTradeRoute(const CvUnit* self, const CvPlot* pPlot, bool& result);static void AfterCvUnit_canMakeTradeRoute(const CvUnit* self, const CvPlot* pPlot, bool& result);static bool ReplaceCvUnit_canMakeTradeRoute(bool (*original)(const CvUnit*, const CvPlot*), const CvUnit* self, const CvPlot* pPlot);CivRegisterBefore<CivHooks::CvUnit_canMakeTradeRoute>(host, &BeforeCvUnit_canMakeTradeRoute);CivRegisterAfter<CivHooks::CvUnit_canMakeTradeRoute>(host, &AfterCvUnit_canMakeTradeRoute);CivRegisterReplace<CivHooks::CvUnit_canMakeTradeRoute>(host, &ReplaceCvUnit_canMakeTradeRoute);
Code
6721bool CvUnit::canMakeTradeRoute(const CvPlot* pPlot) const6722{6723 VALIDATE_OBJECT6724 if (!isTrade())6725 {6726 return false;6727 }67286729 if (pPlot == NULL)6730 {6731 return false;6732 }67336734 CvCity* pCity = pPlot->getPlotCity();6735 if (pCity == NULL)6736 {6737 return false;6738 }67396740 if (pCity->getOwner() != getOwner())6741 {6742 return false;6743 }67446745 return true;6746}
Calls
Called by
- CvUnit::CanDoInterfaceMode(InterfaceModeTypes, bool)
- CvUnit::canMakeTradeRouteAt(const CvPlot *, int, int, TradeConnectionType) const
- CvUnitMission::CanStartMission(UnitHandle, int, int, int, CvPlot *, bool)
- CvLuaPlayer::GetPotentialInternationalTradeRouteDestinationsHelper(lua_State *, CvPlayerAI *, CvUnit *, CvPlot *)
- CvLuaUnit::lCanMakeTradeRoute(lua_State *)