Bazaar developer reference

CvArmyAI::GetNextUnit()

Defined in
CvArmyAI.cpp, line 795
Class
CvArmyAI
Hook name
CivHooks::CvArmyAI_GetNextUnit

Hooks

static bool BeforeCvArmyAI_GetNextUnit(CvArmyAI* self, UnitHandle& result);static void AfterCvArmyAI_GetNextUnit(CvArmyAI* self, UnitHandle& result);static UnitHandle ReplaceCvArmyAI_GetNextUnit(UnitHandle (*original)(CvArmyAI*), CvArmyAI* self);CivRegisterBefore<CivHooks::CvArmyAI_GetNextUnit>(host, &BeforeCvArmyAI_GetNextUnit);CivRegisterAfter<CivHooks::CvArmyAI_GetNextUnit>(host, &AfterCvArmyAI_GetNextUnit);CivRegisterReplace<CivHooks::CvArmyAI_GetNextUnit>(host, &ReplaceCvArmyAI_GetNextUnit);

Code

794/// Retrieve units from the army - subsequent call (UnitHandle version)795UnitHandle CvArmyAI::GetNextUnit()796{797	UnitHandle pRtnValue;798799	int iUnitID = GetNextUnitID();800	if(iUnitID != ARMY_NO_UNIT)801	{802		pRtnValue = UnitHandle(GET_PLAYER(m_eOwner).getUnit(iUnitID));803804		FAssertMsg(pRtnValue, "Bogus unit in army - tell Ed");805	}806807	return pRtnValue;808}

Calls

Called by