Bazaar developer reference

CvMinorCivQuest::IsRevoked()

Defined in
CvMinorCivAI.cpp, line 693
Class
CvMinorCivQuest
Hook name
CivHooks::CvMinorCivQuest_IsRevoked
Lua events
GameEvents.QuestIsRevoked

Hooks

static bool BeforeCvMinorCivQuest_IsRevoked(CvMinorCivQuest* self, bool& result);static void AfterCvMinorCivQuest_IsRevoked(CvMinorCivQuest* self, bool& result);static bool ReplaceCvMinorCivQuest_IsRevoked(bool (*original)(CvMinorCivQuest*), CvMinorCivQuest* self);CivRegisterBefore<CivHooks::CvMinorCivQuest_IsRevoked>(host, &BeforeCvMinorCivQuest_IsRevoked);CivRegisterAfter<CivHooks::CvMinorCivQuest_IsRevoked>(host, &AfterCvMinorCivQuest_IsRevoked);CivRegisterReplace<CivHooks::CvMinorCivQuest_IsRevoked>(host, &ReplaceCvMinorCivQuest_IsRevoked);

Code

692/// Is this quest now revoked (ie. because the player bullied us)?693bool CvMinorCivQuest::IsRevoked()694{695	if(GET_PLAYER(m_eMinor).GetMinorCivAI()->IsRecentlyBulliedByMajor(m_eAssignedPlayer))696	{697#if defined(MOD_EVENTS_QUESTS)698		if (UseEvents()) {699			if (m_pQuestInfo->isRevokeOnBully()) return true;700			// Drop through to send the event below701		} else {702#endif703		if(m_eType == MINOR_CIV_QUEST_ROUTE)704			return true;705		if(m_eType == MINOR_CIV_QUEST_CONNECT_RESOURCE)706			return true;707		if(m_eType == MINOR_CIV_QUEST_CONSTRUCT_WONDER)708			return true;709		if(m_eType == MINOR_CIV_QUEST_GREAT_PERSON)710			return true;711		if(m_eType == MINOR_CIV_QUEST_FIND_PLAYER)712			return true;713		if(m_eType == MINOR_CIV_QUEST_FIND_NATURAL_WONDER)714			return true;715		if(m_eType == MINOR_CIV_QUEST_GIVE_GOLD)716			return true;717		if(m_eType == MINOR_CIV_QUEST_PLEDGE_TO_PROTECT)718			return true;719		if(m_eType == MINOR_CIV_QUEST_INVEST)720			return true;721		if(m_eType == MINOR_CIV_QUEST_BULLY_CITY_STATE)722			return true;723		if(m_eType == MINOR_CIV_QUEST_DENOUNCE_MAJOR)724			return true;725		if(m_eType == MINOR_CIV_QUEST_SPREAD_RELIGION)726			return true;727		if(m_eType == MINOR_CIV_QUEST_TRADE_ROUTE)728			return true;729#if defined(MOD_EVENTS_QUESTS)730		}731#endif732	}733	734#if defined(MOD_EVENTS_QUESTS)735	if (UseEvents() && !IsInternal()) {736		if (GAMEEVENTINVOKE_TESTANY(GAMEEVENT_QuestIsRevoked, m_eAssignedPlayer, m_eMinor, m_eType) == GAMEEVENTRETURN_TRUE) {737			return true;738		}739		740		return false;741	} else {742#endif743		// Placeholder in case any internal quests ever need it744#if defined(MOD_EVENTS_QUESTS)745	}746#endif747748	return false;749}

Calls

Called by