mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-27 13:15:55 +01:00
Catch missing location on finish objectives, fixes #1191
This commit is contained in:
parent
311eac2d28
commit
1b63795eb8
@ -346,7 +346,6 @@ public class Quester {
|
||||
if (questData.containsKey(quest)) {
|
||||
return questData.get(quest);
|
||||
}
|
||||
plugin.getLogger().info("Creating new data for quest " + quest.getId());
|
||||
return new QuestData(this);
|
||||
}
|
||||
|
||||
@ -2400,8 +2399,14 @@ public class Quester {
|
||||
p.sendMessage(message);
|
||||
} else if (objective.equalsIgnoreCase("reachLocation")) {
|
||||
String obj = Lang.get(p, "goTo");
|
||||
obj = obj.replace("<location>", getCurrentStage(quest).locationNames.get(getCurrentStage(quest)
|
||||
.locationsToReach.indexOf(location)));
|
||||
try {
|
||||
obj = obj.replace("<location>", getCurrentStage(quest).locationNames.get(getCurrentStage(quest)
|
||||
.locationsToReach.indexOf(location)));
|
||||
} catch(IndexOutOfBoundsException e) {
|
||||
plugin.getLogger().severe("Unable to get final location " + location + " for quest ID "
|
||||
+ quest.getId() + ", please report on Github");
|
||||
obj = obj.replace("<location>", "ERROR");
|
||||
}
|
||||
String message = ChatColor.GREEN + "(" + Lang.get(p, "completed") + ") " + obj;
|
||||
p.sendMessage(message);
|
||||
} else if (co != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user