Bazaar developer reference

CvMinorCivAI::GetTurnLastPledgedProtectionByMajor(PlayerTypes) const

Defined in
CvMinorCivAI.cpp, line 7494
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_GetTurnLastPledgedProtectionByMajor

Hooks

static bool BeforeCvMinorCivAI_GetTurnLastPledgedProtectionByMajor(const CvMinorCivAI* self, PlayerTypes eMajor, int& result);static void AfterCvMinorCivAI_GetTurnLastPledgedProtectionByMajor(const CvMinorCivAI* self, PlayerTypes eMajor, int& result);static int ReplaceCvMinorCivAI_GetTurnLastPledgedProtectionByMajor(int (*original)(const CvMinorCivAI*, PlayerTypes), const CvMinorCivAI* self, PlayerTypes eMajor);CivRegisterBefore<CivHooks::CvMinorCivAI_GetTurnLastPledgedProtectionByMajor>(host, &BeforeCvMinorCivAI_GetTurnLastPledgedProtectionByMajor);CivRegisterAfter<CivHooks::CvMinorCivAI_GetTurnLastPledgedProtectionByMajor>(host, &AfterCvMinorCivAI_GetTurnLastPledgedProtectionByMajor);CivRegisterReplace<CivHooks::CvMinorCivAI_GetTurnLastPledgedProtectionByMajor>(host, &ReplaceCvMinorCivAI_GetTurnLastPledgedProtectionByMajor);

Code

7494int CvMinorCivAI::GetTurnLastPledgedProtectionByMajor(PlayerTypes eMajor) const7495{7496	CvAssertMsg(eMajor >= 0, "eMajor is expected to be non-negative (invalid Index)");7497	CvAssertMsg(eMajor < MAX_MAJOR_CIVS, "eMajor is expected to be within maximum bounds (invalid Index)");7498	if(eMajor < 0 || eMajor >= MAX_MAJOR_CIVS) return -1;74997500	return m_aiTurnLastPledged[eMajor];7501}

Called by