mirror of
https://github.com/PikaMug/Quests.git
synced 2024-09-09 14:08:02 +02:00
Resolve skipping stages with delays after relogging, fixes #810
This commit is contained in:
parent
a77a917e3f
commit
98372258eb
@ -181,6 +181,12 @@ public class CmdExecutor implements CommandExecutor {
|
||||
if (quester.getCurrentQuests().isEmpty() == false) {
|
||||
for (Quest q : quester.getCurrentQuests().keySet()) {
|
||||
Stage stage = quester.getCurrentStage(q);
|
||||
LinkedList<Stage> stages = q.getStages();
|
||||
for (Stage s : stages) {
|
||||
if (s.equals(quester.getCurrentStage(q))) {
|
||||
System.out.println(ChatColor.LIGHT_PURPLE + "quest (" + Lang.get("stageEditorStage") + " " + (stages.indexOf(s) + 1) + ")");
|
||||
}
|
||||
}
|
||||
q.updateCompass(quester, stage);
|
||||
if (plugin.getQuester(player.getUniqueId()).getQuestData(q).delayStartTime == 0) {
|
||||
String msg = Lang.get(player, "questObjectivesTitle");
|
||||
@ -536,14 +542,10 @@ public class CmdExecutor implements CommandExecutor {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest") + " " + ChatColor.DARK_PURPLE + Lang.get("none"));
|
||||
} else {
|
||||
cs.sendMessage(ChatColor.YELLOW + Lang.get("currentQuest"));
|
||||
for (Quest q : quester.getCurrentQuests().keySet()) {
|
||||
String msg = ChatColor.LIGHT_PURPLE + " - " + ChatColor.DARK_PURPLE + q.getName();
|
||||
LinkedList<Stage> stages = q.getStages();
|
||||
for (Stage s : stages) {
|
||||
if (s.equals(quester.getCurrentStage(q))) {
|
||||
msg += ChatColor.LIGHT_PURPLE + " (" + Lang.get("stageEditorStage") + " " + (stages.indexOf(s) + 1) + ")";
|
||||
}
|
||||
}
|
||||
for (Entry<Quest, Integer> set : quester.getCurrentQuests().entrySet()) {
|
||||
Quest q = set.getKey();
|
||||
String msg = ChatColor.LIGHT_PURPLE + " - " + ChatColor.DARK_PURPLE + q.getName()
|
||||
+ ChatColor.LIGHT_PURPLE + " (" + Lang.get("stageEditorStage") + " " + (set.getValue() + 1) + ")";
|
||||
cs.sendMessage(msg);
|
||||
}
|
||||
}
|
||||
|
@ -783,7 +783,7 @@ public class PlayerListener implements Listener {
|
||||
quester.checkQuest(quest);
|
||||
}
|
||||
for (Quest quest : quester.getCurrentQuests().keySet()) {
|
||||
if (quester.getCurrentStage(quest).getDelay() > -1) {
|
||||
if (quester.getCurrentStage(quest).getDelay() > -1 && quester.getQuestData(quest).delayOver == false) {
|
||||
quester.startStageTimer(quest);
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ public class StageTimer implements Runnable {
|
||||
}
|
||||
quest.completeQuest(quester);
|
||||
} else {
|
||||
System.out.println("get delay = " + quester.getCurrentStage(quest).getDelay());
|
||||
Stage currentStage = quester.getCurrentStage(quest);
|
||||
int stageNum = quester.getCurrentQuests().get(quest) + 1;
|
||||
quester.hardQuit(quest);
|
||||
|
Loading…
Reference in New Issue
Block a user