CvUnit::DoUpgrade(bool)
- Defined in
- CvUnit.cpp, line 11226
- Class
- CvUnit
- Hook name
CivHooks::CvUnit_DoUpgrade
Hooks
static bool BeforeCvUnit_DoUpgrade(CvUnit* self, bool bFree, CvUnit*& result);static void AfterCvUnit_DoUpgrade(CvUnit* self, bool bFree, CvUnit*& result);static CvUnit* ReplaceCvUnit_DoUpgrade(CvUnit* (*original)(CvUnit*, bool), CvUnit* self, bool bFree);CivRegisterBefore<CivHooks::CvUnit_DoUpgrade>(host, &BeforeCvUnit_DoUpgrade);CivRegisterAfter<CivHooks::CvUnit_DoUpgrade>(host, &AfterCvUnit_DoUpgrade);CivRegisterReplace<CivHooks::CvUnit_DoUpgrade>(host, &ReplaceCvUnit_DoUpgrade);
Code
11224/// Upgrades this Unit - returns a pointer to the newly created unit11225#if defined(MOD_API_EXTENSIONS)11226CvUnit* CvUnit::DoUpgrade(bool bFree)11227#else11228CvUnit* CvUnit::DoUpgrade()11229#endif11230{11231 VALIDATE_OBJECT1123211233 UnitTypes eUnitType = GetUpgradeUnitType();1123411235#if defined(MOD_API_EXTENSIONS)11236 return DoUpgradeTo(eUnitType, bFree);11237}