Bazaar developer reference

CvUnit::maxMoves() const

Defined in
CvUnit.cpp, line 11638
Class
CvUnit
Hook name
CivHooks::CvUnit_maxMoves

Hooks

static bool BeforeCvUnit_maxMoves(const CvUnit* self, int& result);static void AfterCvUnit_maxMoves(const CvUnit* self, int& result);static int ReplaceCvUnit_maxMoves(int (*original)(const CvUnit*), const CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_maxMoves>(host, &BeforeCvUnit_maxMoves);CivRegisterAfter<CivHooks::CvUnit_maxMoves>(host, &AfterCvUnit_maxMoves);CivRegisterReplace<CivHooks::CvUnit_maxMoves>(host, &ReplaceCvUnit_maxMoves);

Code

11638int CvUnit::maxMoves() const11639{11640	VALIDATE_OBJECT11641#if defined(MOD_PROMOTIONS_FLAGSHIP)11642	if(IsGreatGeneral() || (MOD_PROMOTIONS_FLAGSHIP && IsGreatAdmiral()))11643#else11644	if(IsGreatGeneral())11645#endif11646	{11647		return GetGreatGeneralStackMovement();11648	}11649	else11650	{11651		return (baseMoves() * GC.getMOVE_DENOMINATOR());	// WARNING: Uses the current embark state of the unit!11652	}11653}

Calls

Called by