Bazaar developer reference

CvUnit::canFound(const CvPlot *, bool) const

Defined in
CvUnit.cpp, line 7972
Class
CvUnit
Hook name
CivHooks::CvUnit_canFound

Hooks

static bool BeforeCvUnit_canFound(const CvUnit* self, const CvPlot* pPlot, bool bTestVisible, bool& result);static void AfterCvUnit_canFound(const CvUnit* self, const CvPlot* pPlot, bool bTestVisible, bool& result);static bool ReplaceCvUnit_canFound(bool (*original)(const CvUnit*, const CvPlot*, bool), const CvUnit* self, const CvPlot* pPlot, bool bTestVisible);CivRegisterBefore<CivHooks::CvUnit_canFound>(host, &BeforeCvUnit_canFound);CivRegisterAfter<CivHooks::CvUnit_canFound>(host, &AfterCvUnit_canFound);CivRegisterReplace<CivHooks::CvUnit_canFound>(host, &ReplaceCvUnit_canFound);

Code

7972bool CvUnit::canFound(const CvPlot* pPlot, bool bTestVisible) const7973{7974	VALIDATE_OBJECT7975	if(!m_pUnitInfo->IsFound())7976	{7977		if(!m_pUnitInfo->IsFoundAbroad())7978		{7979			return false;7980		}7981		else7982		{7983#if defined(MOD_BUGFIX_USE_GETTERS)7984			CvCity* pCapital = GET_MY_PLAYER().getCapitalCity();7985#else7986			CvCity* pCapital = GET_PLAYER(m_eOwner).getCapitalCity();7987#endif7988			if(!pCapital || pCapital->getArea() == pPlot->getArea())7989			{7990				return false;7991			}7992		}7993	}79947995	if(!(GET_PLAYER(getOwner()).canFound(pPlot->getX(), pPlot->getY(), bTestVisible)))7996	{7997		return false;7998	}79998000	return true;8001}

Calls

Called by