Bazaar developer reference

CvMinorCivAI::IsRecentlyBulliedByMajor(PlayerTypes) const

Defined in
CvMinorCivAI.cpp, line 9647
Class
CvMinorCivAI
Hook name
CivHooks::CvMinorCivAI_IsRecentlyBulliedByMajor

Hooks

static bool BeforeCvMinorCivAI_IsRecentlyBulliedByMajor(const CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static void AfterCvMinorCivAI_IsRecentlyBulliedByMajor(const CvMinorCivAI* self, PlayerTypes ePlayer, bool& result);static bool ReplaceCvMinorCivAI_IsRecentlyBulliedByMajor(bool (*original)(const CvMinorCivAI*, PlayerTypes), const CvMinorCivAI* self, PlayerTypes ePlayer);CivRegisterBefore<CivHooks::CvMinorCivAI_IsRecentlyBulliedByMajor>(host, &BeforeCvMinorCivAI_IsRecentlyBulliedByMajor);CivRegisterAfter<CivHooks::CvMinorCivAI_IsRecentlyBulliedByMajor>(host, &AfterCvMinorCivAI_IsRecentlyBulliedByMajor);CivRegisterReplace<CivHooks::CvMinorCivAI_IsRecentlyBulliedByMajor>(host, &ReplaceCvMinorCivAI_IsRecentlyBulliedByMajor);

Code

9647bool CvMinorCivAI::IsRecentlyBulliedByMajor(PlayerTypes ePlayer) const9648{9649	CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");9650	CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");9651	if(ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false;96529653	const int iRecentlyBulliedTurnInterval = 20; //antonjs: todo: constant/XML9654	return (m_aiTurnLastBullied[ePlayer] >= 0 && m_aiTurnLastBullied[ePlayer] >= (GC.getGame().getGameTurn() - iRecentlyBulliedTurnInterval)); // -1 means never bullied9655}

Calls

Called by