Ignore quest requirements if empty, fixes #2083

This commit is contained in:
PikaMug 2023-04-01 13:51:58 -04:00
parent 0ee5e9e730
commit 3c8acea21a
2 changed files with 14 additions and 8 deletions

View File

@ -590,10 +590,12 @@ public class Quest implements IQuest {
return false;
}
for (final IQuest q : quester.getCompletedQuestsTemp()) {
if (!requirements.getNeededQuestIds().contains(q.getName())) {
if (!requirements.getNeededQuestIds().isEmpty()
&& requirements.getNeededQuestIds().contains(q.getName())) {
return false;
}
if (!requirements.getBlockQuestIds().contains(q.getName())) {
if (!requirements.getBlockQuestIds().isEmpty()
&& !requirements.getBlockQuestIds().contains(q.getName())) {
return false;
}
}

View File

@ -1056,13 +1056,17 @@ public class Quester implements IQuester {
}
for (final IQuest q : completedQuests) {
if (q != null) {
if (requirements.getNeededQuestIds().contains(q.getId())) {
finishedRequirements.add(ChatColor.GREEN + q.getName());
} else {
unfinishedRequirements.add(ChatColor.GRAY + q.getName());
if (!requirements.getNeededQuestIds().isEmpty()) {
if (requirements.getNeededQuestIds().contains(q.getId())) {
finishedRequirements.add(ChatColor.GREEN + q.getName());
} else {
unfinishedRequirements.add(ChatColor.GRAY + q.getName());
}
}
if (requirements.getBlockQuestIds().contains(q.getId())) {
current.add(ChatColor.RED + quest.getName());
if (!requirements.getBlockQuestIds().isEmpty()) {
if (requirements.getBlockQuestIds().contains(q.getId())) {
current.add(ChatColor.RED + quest.getName());
}
}
}
}