Bazaar developer reference

CvMinorCivAI::SetUnitSpawnCounter(PlayerTypes, int)

Defined in
CvMinorCivAI.cpp, line 8383
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_SetUnitSpawnCounter

Hooks

static bool BeforeCvMinorCivAI_SetUnitSpawnCounter(CvMinorCivAI* self, PlayerTypes ePlayer, int iValue);static void AfterCvMinorCivAI_SetUnitSpawnCounter(CvMinorCivAI* self, PlayerTypes ePlayer, int iValue);static void ReplaceCvMinorCivAI_SetUnitSpawnCounter(void (*original)(CvMinorCivAI*, PlayerTypes, int), CvMinorCivAI* self, PlayerTypes ePlayer, int iValue);CivRegisterBefore<CivHooks::CvMinorCivAI_SetUnitSpawnCounter>(host, &BeforeCvMinorCivAI_SetUnitSpawnCounter);CivRegisterAfter<CivHooks::CvMinorCivAI_SetUnitSpawnCounter>(host, &AfterCvMinorCivAI_SetUnitSpawnCounter);CivRegisterReplace<CivHooks::CvMinorCivAI_SetUnitSpawnCounter>(host, &ReplaceCvMinorCivAI_SetUnitSpawnCounter);

Code

8382// Sets how long before we spawn a free unit for ePlayer8383void CvMinorCivAI::SetUnitSpawnCounter(PlayerTypes ePlayer, int iValue)8384{8385	CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");8386	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");8387	if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return;83888389	m_aiUnitSpawnCounter[ePlayer] = iValue;8390}

Called by