Bazaar developer reference

CvUnit::CanUpgradeRightNow(bool) const

Defined in
CvUnit.cpp, line 10935
Class
CvUnit
Hook name
CivHooks::CvUnit_CanUpgradeRightNow

Hooks

static bool BeforeCvUnit_CanUpgradeRightNow(const CvUnit* self, bool bOnlyTestVisible, bool& result);static void AfterCvUnit_CanUpgradeRightNow(const CvUnit* self, bool bOnlyTestVisible, bool& result);static bool ReplaceCvUnit_CanUpgradeRightNow(bool (*original)(const CvUnit*, bool), const CvUnit* self, bool bOnlyTestVisible);CivRegisterBefore<CivHooks::CvUnit_CanUpgradeRightNow>(host, &BeforeCvUnit_CanUpgradeRightNow);CivRegisterAfter<CivHooks::CvUnit_CanUpgradeRightNow>(host, &AfterCvUnit_CanUpgradeRightNow);CivRegisterReplace<CivHooks::CvUnit_CanUpgradeRightNow>(host, &ReplaceCvUnit_CanUpgradeRightNow);

Code

10934/// Can this Unit upgrade with anything right now?10935bool CvUnit::CanUpgradeRightNow(bool bOnlyTestVisible) const10936{10937	VALIDATE_OBJECT10938	// Is Unit in a state where it can upgrade?10939	if(!isReadyForUpgrade())10940		return false;1094110942	UnitTypes eUpgradeUnitType = GetUpgradeUnitType();10943	10944#if defined(MOD_API_EXTENSIONS)10945	return CanUpgradeTo(eUpgradeUnitType, bOnlyTestVisible);10946}

Calls

Called by