Bazaar developer reference

CvUnit::getDomainType() const

Defined in
CvUnit.cpp, line 11442
Class
CvUnit
Hook name
CivHooks::CvUnit_getDomainType

Hooks

static bool BeforeCvUnit_getDomainType(const CvUnit* self, DomainTypes& result);static void AfterCvUnit_getDomainType(const CvUnit* self, DomainTypes& result);static DomainTypes ReplaceCvUnit_getDomainType(DomainTypes (*original)(const CvUnit*), const CvUnit* self);CivRegisterBefore<CivHooks::CvUnit_getDomainType>(host, &BeforeCvUnit_getDomainType);CivRegisterAfter<CivHooks::CvUnit_getDomainType>(host, &AfterCvUnit_getDomainType);CivRegisterReplace<CivHooks::CvUnit_getDomainType>(host, &ReplaceCvUnit_getDomainType);

Code

11442DomainTypes CvUnit::getDomainType() const11443{11444	VALIDATE_OBJECT11445	DomainTypes eDomain = (DomainTypes) m_pUnitInfo->GetDomainType();11446	// antonjs: Added for Smoky Skies Scenario. If unit is DOMAIN_HOVER, dynamically determine its domain by the type of terrain it is over11447	if (eDomain == DOMAIN_HOVER)11448	{11449		CvPlot* pPlot = plot();11450		CvAssertMsg(pPlot, "pPlot is unexpectedly NULL. Please send Anton your save file and version.");11451		if (pPlot)11452		{11453			if (pPlot->isWater())11454			{11455				return DOMAIN_SEA;11456			}11457			else11458			{11459				return DOMAIN_LAND;11460			}11461		}11462	}11463	11464	return eDomain;11465}

Calls

Called by

168 functions in 25 files