CvMinorCivAI::GetContestValueForPlayer(PlayerTypes, MinorCivQuestTypes)
- Defined in
- CvMinorCivAI.cpp, line 5471
- Class
- CvMinorCivAI
- Hook name
CivHooks::CvMinorCivAI_GetContestValueForPlayer
Hooks
static bool BeforeCvMinorCivAI_GetContestValueForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer, MinorCivQuestTypes eType, int& result);static void AfterCvMinorCivAI_GetContestValueForPlayer(CvMinorCivAI* self, PlayerTypes ePlayer, MinorCivQuestTypes eType, int& result);static int ReplaceCvMinorCivAI_GetContestValueForPlayer(int (*original)(CvMinorCivAI*, PlayerTypes, MinorCivQuestTypes), CvMinorCivAI* self, PlayerTypes ePlayer, MinorCivQuestTypes eType);CivRegisterBefore<CivHooks::CvMinorCivAI_GetContestValueForPlayer>(host, &BeforeCvMinorCivAI_GetContestValueForPlayer);CivRegisterAfter<CivHooks::CvMinorCivAI_GetContestValueForPlayer>(host, &AfterCvMinorCivAI_GetContestValueForPlayer);CivRegisterReplace<CivHooks::CvMinorCivAI_GetContestValueForPlayer>(host, &ReplaceCvMinorCivAI_GetContestValueForPlayer);
Code
5471int CvMinorCivAI::GetContestValueForPlayer(PlayerTypes ePlayer, MinorCivQuestTypes eType)5472{5473 CvAssertMsg(ePlayer >= 0, "ePlayer is expected to be non-negative (invalid Index)");5474 CvAssertMsg(ePlayer < MAX_MAJOR_CIVS, "ePlayer is expected to be within maximum bounds (invalid Index)");5475 if (ePlayer < 0 || ePlayer >= MAX_MAJOR_CIVS) return false;54765477 for (uint iQuestLoop = 0; iQuestLoop < m_QuestsGiven[ePlayer].size(); iQuestLoop++)5478 {5479 if (m_QuestsGiven[ePlayer][iQuestLoop].GetType() == eType)5480 {5481 return m_QuestsGiven[ePlayer][iQuestLoop].GetContestValueForPlayer(ePlayer);5482 }5483 }54845485 return -1;5486}
Calls
BaseVector::operator[]BaseVector::operator[]BaseVector::size- CvMinorCivQuest::GetContestValueForPlayer(PlayerTypes)
- CvMinorCivQuest::GetType() const