mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-25 18:48:15 +01:00
Avoid constant out of range exceptions when a players' current quest/stages lists get out of sync. Not sure why this happens, though.
This commit is contained in:
parent
322c2d908a
commit
23304e0b1d
@ -2578,7 +2578,10 @@ public class Quester {
|
|||||||
List<String> questNames = data.getStringList("currentQuests");
|
List<String> questNames = data.getStringList("currentQuests");
|
||||||
List<Integer> questStages = data.getIntegerList("currentStages");
|
List<Integer> questStages = data.getIntegerList("currentStages");
|
||||||
|
|
||||||
for (int i = 0; i < questNames.size(); i++) {
|
// These appear to differ sometimes? That seems bad.
|
||||||
|
int maxSize = Math.min(questNames.size(), questStages.size());
|
||||||
|
|
||||||
|
for (int i = 0; i < maxSize; i++) {
|
||||||
if (plugin.getQuest(questNames.get(i)) != null) {
|
if (plugin.getQuest(questNames.get(i)) != null) {
|
||||||
currentQuests.put(plugin.getQuest(questNames.get(i)), questStages.get(i));
|
currentQuests.put(plugin.getQuest(questNames.get(i)), questStages.get(i));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user