Bazaar developer reference

CvPlayer::HasUnit(UnitTypes)

Defined in
CvPlayer.cpp, line 28443
Class
CvPlayer
Hook name
CivHooks::CvPlayer_HasUnit

Hooks

static bool BeforeCvPlayer_HasUnit(CvPlayer* self, UnitTypes iUnitType, bool& result);static void AfterCvPlayer_HasUnit(CvPlayer* self, UnitTypes iUnitType, bool& result);static bool ReplaceCvPlayer_HasUnit(bool (*original)(CvPlayer*, UnitTypes), CvPlayer* self, UnitTypes iUnitType);CivRegisterBefore<CivHooks::CvPlayer_HasUnit>(host, &BeforeCvPlayer_HasUnit);CivRegisterAfter<CivHooks::CvPlayer_HasUnit>(host, &AfterCvPlayer_HasUnit);CivRegisterReplace<CivHooks::CvPlayer_HasUnit>(host, &ReplaceCvPlayer_HasUnit);

Code

28443bool CvPlayer::HasUnit(UnitTypes iUnitType)28444{28445	int iLoopUnit;2844628447	for (CvUnit* pLoopUnit = firstUnit(&iLoopUnit); pLoopUnit != NULL; pLoopUnit = nextUnit(&iLoopUnit)) {28448		if (!pLoopUnit->isDelayedDeath()) {28449			if (pLoopUnit->IsUnit(iUnitType)) {28450				return true;28451			}28452		}28453	}2845428455	return false;28456}

Calls

Called by