CvDiplomacyAI::IsHasActiveGoldQuest()
- Defined in
- CvDiplomacyAI.cpp, line 4517
- Class
- CvDiplomacyAI
- Hook name
CivHooks::CvDiplomacyAI_IsHasActiveGoldQuest
Hooks
static bool BeforeCvDiplomacyAI_IsHasActiveGoldQuest(CvDiplomacyAI* self, bool& result);static void AfterCvDiplomacyAI_IsHasActiveGoldQuest(CvDiplomacyAI* self, bool& result);static bool ReplaceCvDiplomacyAI_IsHasActiveGoldQuest(bool (*original)(CvDiplomacyAI*), CvDiplomacyAI* self);CivRegisterBefore<CivHooks::CvDiplomacyAI_IsHasActiveGoldQuest>(host, &BeforeCvDiplomacyAI_IsHasActiveGoldQuest);CivRegisterAfter<CivHooks::CvDiplomacyAI_IsHasActiveGoldQuest>(host, &AfterCvDiplomacyAI_IsHasActiveGoldQuest);CivRegisterReplace<CivHooks::CvDiplomacyAI_IsHasActiveGoldQuest>(host, &ReplaceCvDiplomacyAI_IsHasActiveGoldQuest);
Code
4516/// Does this AI have a gold quest active with any minor civ?4517bool CvDiplomacyAI::IsHasActiveGoldQuest()4518{4519 //antonjs: consider: optimize4520 for(int iMinorLoop = MAX_MAJOR_CIVS; iMinorLoop < MAX_CIV_PLAYERS; iMinorLoop++)4521 {4522 PlayerTypes eMinor = (PlayerTypes)iMinorLoop;4523 if(GET_PLAYER(eMinor).GetMinorCivAI()->IsActiveQuestForPlayer(GetPlayer()->GetID(), MINOR_CIV_QUEST_GIVE_GOLD))4524 return true;4525 if(GET_PLAYER(eMinor).GetMinorCivAI()->IsActiveQuestForPlayer(GetPlayer()->GetID(), MINOR_CIV_QUEST_INVEST))4526 return true;4527 }4528 return false;4529}