Bazaar developer reference

CvMinorCivAI::GetCurrentCultureBonus(PlayerTypes)

Defined in
CvMinorCivAI.cpp, line 7886
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_GetCurrentCultureBonus

Hooks

static bool BeforeCvMinorCivAI_GetCurrentCultureBonus(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static void AfterCvMinorCivAI_GetCurrentCultureBonus(CvMinorCivAI* self, PlayerTypes ePlayer, int& result);static int ReplaceCvMinorCivAI_GetCurrentCultureBonus(int (*original)(CvMinorCivAI*, PlayerTypes), CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_GetCurrentCultureBonus>(host, &BeforeCvMinorCivAI_GetCurrentCultureBonus);CivRegisterAfter<CivHooks::CvMinorCivAI_GetCurrentCultureBonus>(host, &AfterCvMinorCivAI_GetCurrentCultureBonus);CivRegisterReplace<CivHooks::CvMinorCivAI_GetCurrentCultureBonus>(host, &ReplaceCvMinorCivAI_GetCurrentCultureBonus);

Code

7886int CvMinorCivAI::GetCurrentCultureBonus(PlayerTypes ePlayer)7887{7888	CvAssertMsg(ePlayer >= 0, "eIndex is expected to be non-negative (invalid Index)");7889	CvAssertMsg(ePlayer < MAX_PLAYERS, "ePlayer is expected to be within maximum bounds (invalid Index)");7890	if(ePlayer < 0 || ePlayer >= MAX_PLAYERS) return 0;78917892	int iAmount = 0;78937894	iAmount += GetCurrentCultureFlatBonus(ePlayer);7895	iAmount += GetCurrentCulturePerBuildingBonus(ePlayer); //antonjs: This feature was prototyped, but later removed. Its value is 0 (no bonus).78967897	return iAmount;7898}

Calls

Called by