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