Bazaar developer reference

CvCombatInfo::getCity(BattleUnitTypes) const

Defined in
CvStructs.cpp, line 256
Class
CvCombatInfo
Hook name
CivHooks::CvCombatInfo_getCity

Hooks

static bool BeforeCvCombatInfo_getCity(const CvCombatInfo* self, BattleUnitTypes unitType, CvCity*& result);static void AfterCvCombatInfo_getCity(const CvCombatInfo* self, BattleUnitTypes unitType, CvCity*& result);static CvCity* ReplaceCvCombatInfo_getCity(CvCity* (*original)(const CvCombatInfo*, BattleUnitTypes), const CvCombatInfo* self, BattleUnitTypes unitType);CivRegisterBefore<CivHooks::CvCombatInfo_getCity>(host, &BeforeCvCombatInfo_getCity);CivRegisterAfter<CivHooks::CvCombatInfo_getCity>(host, &AfterCvCombatInfo_getCity);CivRegisterReplace<CivHooks::CvCombatInfo_getCity>(host, &ReplaceCvCombatInfo_getCity);

Code

256CvCity* CvCombatInfo::getCity(BattleUnitTypes unitType) const257{258	checkBattleUnitType(unitType);259	if(m_pCities[unitType])260		return m_pCities[unitType];261	else if(unitType == BATTLE_UNIT_DEFENDER && m_pTargetPlot)262	{263		if(m_pTargetPlot->isCity())264			return m_pTargetPlot->getPlotCity();265	}266	return NULL;267}

Calls

Called by