Bazaar developer reference

CvMinorCivAI::GetUnitSpawnCounter(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 8373
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_GetUnitSpawnCounter

Hooks

static bool BeforeCvMinorCivAI_GetUnitSpawnCounter(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static void AfterCvMinorCivAI_GetUnitSpawnCounter(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvMinorCivAI_GetUnitSpawnCounter(int (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_GetUnitSpawnCounter>(host, &BeforeCvMinorCivAI_GetUnitSpawnCounter);CivRegisterAfter<CivHooks::CvMinorCivAI_GetUnitSpawnCounter>(host, &AfterCvMinorCivAI_GetUnitSpawnCounter);CivRegisterReplace<CivHooks::CvMinorCivAI_GetUnitSpawnCounter>(host, &ReplaceCvMinorCivAI_GetUnitSpawnCounter);

Code

8372// How long before we spawn a free unit for ePlayer?8373int CvMinorCivAI::GetUnitSpawnCounter(PlayerTypes ePlayer)8374{8375	CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");8376	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");8377	if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return -1; // as defined during Reset()83788379	return m_aiUnitSpawnCounter[ePlayer];8380}

Called by