Bazaar developer reference

CvGame::getBestLandUnitCombat()

Defined in
CvGame.cpp, line 5822
Class
CvGame
Hook name
CivHooks::CvGame_getBestLandUnitCombat

Hooks

static bool BeforeCvGame_getBestLandUnitCombat(CvGame* self, int& result);static void AfterCvGame_getBestLandUnitCombat(CvGame* self, int& result);static int ReplaceCvGame_getBestLandUnitCombat(int (*original)(CvGame*), CvGame* self);CivRegisterBefore<CivHooks::CvGame_getBestLandUnitCombat>(host, &BeforeCvGame_getBestLandUnitCombat);CivRegisterAfter<CivHooks::CvGame_getBestLandUnitCombat>(host, &AfterCvGame_getBestLandUnitCombat);CivRegisterReplace<CivHooks::CvGame_getBestLandUnitCombat>(host, &ReplaceCvGame_getBestLandUnitCombat);

Code

5822int CvGame::getBestLandUnitCombat()5823{5824	const UnitTypes eBestLandUnit = getBestLandUnit();5825	CvUnitEntry* pkUnitInfo = GC.getUnitInfo(eBestLandUnit);5826	if(pkUnitInfo)5827	{5828		return std::max(1, pkUnitInfo->GetCombat());5829	}58305831	return 1;5832}

Calls

Called by