mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Fix review comments
This commit is contained in:
parent
fbf5492fd9
commit
fadf086e61
@ -59,9 +59,6 @@ TGoalVec CompleteQuest::decompose() const
|
||||
|
||||
if(q.quest->mission.heroLevel > 0)
|
||||
return missionLevel();
|
||||
|
||||
if(q.quest->questName == CQuest::missionName(10))
|
||||
return missionKeymaster();
|
||||
|
||||
return TGoalVec();
|
||||
}
|
||||
|
@ -21,6 +21,11 @@ bool CompleteQuest::operator==(const CompleteQuest & other) const
|
||||
return q.quest->qid == other.q.quest->qid;
|
||||
}
|
||||
|
||||
bool isKeyMaster(const QuestInfo & q)
|
||||
{
|
||||
return q.obj && (q.obj->ID == Obj::BORDER_GATE || q.obj->ID == Obj::BORDERGUARD);
|
||||
}
|
||||
|
||||
TGoalVec CompleteQuest::getAllPossibleSubgoals()
|
||||
{
|
||||
TGoalVec solutions;
|
||||
@ -28,6 +33,9 @@ TGoalVec CompleteQuest::getAllPossibleSubgoals()
|
||||
if(!q.quest->isCompleted)
|
||||
{
|
||||
logAi->debug("Trying to realize quest: %s", questToString());
|
||||
|
||||
if(isKeyMaster(q))
|
||||
return missionKeymaster();
|
||||
|
||||
if(!q.quest->mission.artifacts.empty())
|
||||
return missionArt();
|
||||
@ -50,9 +58,6 @@ TGoalVec CompleteQuest::getAllPossibleSubgoals()
|
||||
|
||||
if(q.quest->mission.heroLevel > 0)
|
||||
return missionLevel();
|
||||
|
||||
if(q.quest->questName == CQuest::missionName(10))
|
||||
return missionKeymaster();
|
||||
}
|
||||
|
||||
return TGoalVec();
|
||||
@ -60,7 +65,7 @@ TGoalVec CompleteQuest::getAllPossibleSubgoals()
|
||||
|
||||
TSubgoal CompleteQuest::whatToDoToAchieve()
|
||||
{
|
||||
if(q.quest->questName == CQuest::missionName(0))
|
||||
if(q.quest->mission == Rewardable::Limiter{})
|
||||
{
|
||||
throw cannotFulfillGoalException("Can not complete inactive quest");
|
||||
}
|
||||
|
@ -148,8 +148,8 @@ void CQuestLog::recreateLabelList()
|
||||
int currentLabel = 0;
|
||||
for (int i = 0; i < quests.size(); ++i)
|
||||
{
|
||||
// Quests with MISSION_NONE type don't have text for them and can't be displayed
|
||||
if (quests[i].quest->questName == CQuest::missionName(0))
|
||||
// Quests without mision don't have text for them and can't be displayed
|
||||
if (quests[i].quest->mission == Rewardable::Limiter{})
|
||||
continue;
|
||||
|
||||
if (quests[i].quest->isCompleted)
|
||||
|
Loading…
Reference in New Issue
Block a user