Bazaar developer reference

CvArmyAI::GetFirstUnit()

Defined in
CvArmyAI.cpp, line 779
Class
CvArmyAI
Hook name
CivHooks::CvArmyAI_GetFirstUnit

Hooks

static bool BeforeCvArmyAI_GetFirstUnit(CvArmyAI* self, UnitHandle& result);static void AfterCvArmyAI_GetFirstUnit(CvArmyAI* self, UnitHandle& result);static UnitHandle ReplaceCvArmyAI_GetFirstUnit(UnitHandle (*original)(CvArmyAI*), CvArmyAI* self);CivRegisterBefore<CivHooks::CvArmyAI_GetFirstUnit>(host, &BeforeCvArmyAI_GetFirstUnit);CivRegisterAfter<CivHooks::CvArmyAI_GetFirstUnit>(host, &AfterCvArmyAI_GetFirstUnit);CivRegisterReplace<CivHooks::CvArmyAI_GetFirstUnit>(host, &ReplaceCvArmyAI_GetFirstUnit);

Code

778/// Retrieve units from the army - first call (UnitHandle version)779UnitHandle CvArmyAI::GetFirstUnit()780{781	UnitHandle pRtnValue;782783	int iUnitID = GetFirstUnitID();784	if(iUnitID != ARMY_NO_UNIT)785	{786		pRtnValue = UnitHandle(GET_PLAYER(m_eOwner).getUnit(iUnitID));787788		FAssertMsg(pRtnValue, "Bogus unit in army - tell Ed");789	}790791	return pRtnValue;792}

Calls

Called by