summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorfatpigsarefat <fatpigsarefat@outlook.com>2019-03-17 12:45:06 +0000
committerfatpigsarefat <fatpigsarefat@outlook.com>2019-03-17 12:45:06 +0000
commit36cb577b6fb5c6f8f529627879eeebf6d05061a6 (patch)
treee800991f5460c73461f3f8f28b2c595de49381c2 /src
parentfc3b89203eeb1b291fc437f0ad7da574cc98bd6a (diff)
Workaround for ghost 'mining' tasks in quest data files
- During the quest completer task, each task in the quest will be checked against their task progress instead of checking only the task progresses.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/leonardobishop/quests/Quests.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/com/leonardobishop/quests/Quests.java b/src/main/java/com/leonardobishop/quests/Quests.java
index e23e6fe8..e1acd4a3 100644
--- a/src/main/java/com/leonardobishop/quests/Quests.java
+++ b/src/main/java/com/leonardobishop/quests/Quests.java
@@ -200,8 +200,9 @@ public class Quests extends JavaPlugin {
QuestProgress questProgress = questProgressFile.getQuestProgress(quest);
if (questProgress != null && questProgress.isStarted()) {
boolean complete = true;
- for (TaskProgress taskProgress : questProgress.getTaskProgress()) {
- if (!taskProgress.isCompleted()) {
+ for (Task task : quest.getTasks()) {
+ TaskProgress taskProgress;
+ if ((taskProgress = questProgress.getTaskProgress(task.getId())) == null || !taskProgress.isCompleted()) {
complete = false;
break;
}