Bazaar developer reference

CvPlayer::hasPromotableUnit() const

Defined in
CvPlayer.cpp, line 5273
Class
CvPlayer
Hook name
CivHooks::CvPlayer_hasPromotableUnit

Hooks

static bool BeforeCvPlayer_hasPromotableUnit(const CvPlayer* self, bool& result);static void AfterCvPlayer_hasPromotableUnit(const CvPlayer* self, bool& result);static bool ReplaceCvPlayer_hasPromotableUnit(bool (*original)(const CvPlayer*), const CvPlayer* self);CivRegisterBefore<CivHooks::CvPlayer_hasPromotableUnit>(host, &BeforeCvPlayer_hasPromotableUnit);CivRegisterAfter<CivHooks::CvPlayer_hasPromotableUnit>(host, &AfterCvPlayer_hasPromotableUnit);CivRegisterReplace<CivHooks::CvPlayer_hasPromotableUnit>(host, &ReplaceCvPlayer_hasPromotableUnit);

Code

5273bool CvPlayer::hasPromotableUnit() const5274{5275	const CvUnit* pLoopUnit;5276	int iLoop;52775278	for(pLoopUnit = firstUnit(&iLoop); pLoopUnit; pLoopUnit = nextUnit(&iLoop))5279	{5280		if(pLoopUnit->isPromotionReady() && !pLoopUnit->isDelayedDeath())5281		{5282			return true;5283		}5284	}52855286	return false;5287}

Calls

Called by