Bazaar developer reference

CvMinorCivAI::SetTurnLastPledgedProtectionByMajor(PlayerTypes, int)

Defined in
CvMinorCivAI.cpp, line 7503
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_SetTurnLastPledgedProtectionByMajor

Hooks

static bool BeforeCvMinorCivAI_SetTurnLastPledgedProtectionByMajor(CvMinorCivAI* self, PlayerTypes eMajor, int iTurn);static void AfterCvMinorCivAI_SetTurnLastPledgedProtectionByMajor(CvMinorCivAI* self, PlayerTypes eMajor, int iTurn);static void ReplaceCvMinorCivAI_SetTurnLastPledgedProtectionByMajor(void (*original)(CvMinorCivAI*, PlayerTypes, int), CvMinorCivAI* self, PlayerTypes eMajor, int iTurn);CivRegisterBefore<CivHooks::CvMinorCivAI_SetTurnLastPledgedProtectionByMajor>(host, &BeforeCvMinorCivAI_SetTurnLastPledgedProtectionByMajor);CivRegisterAfter<CivHooks::CvMinorCivAI_SetTurnLastPledgedProtectionByMajor>(host, &AfterCvMinorCivAI_SetTurnLastPledgedProtectionByMajor);CivRegisterReplace<CivHooks::CvMinorCivAI_SetTurnLastPledgedProtectionByMajor>(host, &ReplaceCvMinorCivAI_SetTurnLastPledgedProtectionByMajor);

Code

7503void CvMinorCivAI::SetTurnLastPledgedProtectionByMajor(PlayerTypes eMajor, int iTurn)7504{7505	CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)");7506	CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)");7507	if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return;75087509	m_aiTurnLastPledged[eMajor] = iTurn;7510}

Called by