Bazaar developer reference

CvUnit::canSetUpForRangedAttack(const CvPlot *) const

Defined in
CvUnit.cpp, line 4772
Class
CvUnit
Hook name
CivHooks::CvUnit_canSetUpForRangedAttack

Hooks

static bool BeforeCvUnit_canSetUpForRangedAttack(const CvUnit* self, const CvPlot* arg0, bool& result);static void AfterCvUnit_canSetUpForRangedAttack(const CvUnit* self, const CvPlot* arg0, bool& result);static bool ReplaceCvUnit_canSetUpForRangedAttack(bool (*original)(const CvUnit*, const CvPlot*), const CvUnit* self, const CvPlot* arg0);CivRegisterBefore<CivHooks::CvUnit_canSetUpForRangedAttack>(host, &BeforeCvUnit_canSetUpForRangedAttack);CivRegisterAfter<CivHooks::CvUnit_canSetUpForRangedAttack>(host, &AfterCvUnit_canSetUpForRangedAttack);CivRegisterReplace<CivHooks::CvUnit_canSetUpForRangedAttack>(host, &ReplaceCvUnit_canSetUpForRangedAttack);

Code

4772bool CvUnit::canSetUpForRangedAttack(const CvPlot* /*pPlot*/) const4773{4774	VALIDATE_OBJECT4775	if(!isMustSetUpToRangedAttack())4776	{4777		return false;4778	}47794780	if(isSetUpForRangedAttack())4781	{4782		return false;4783	}47844785	if(isEmbarked())4786		return false;47874788	if(movesLeft() <= 0)4789	{4790		return false;4791	}47924793	return true;4794}

Calls

Called by