mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 07:22:56 +08:00
Check if a sub-quest's data exists before invoking it
This commit is contained in:
parent
9bbdc11334
commit
b77c75a296
@ -78,8 +78,16 @@ public class GameMainQuest {
|
|||||||
Arrays.stream(GameData.getMainQuestDataMap().get(this.parentQuestId).getSubQuests())
|
Arrays.stream(GameData.getMainQuestDataMap().get(this.parentQuestId).getSubQuests())
|
||||||
.map(SubQuestData::getSubId)
|
.map(SubQuestData::getSubId)
|
||||||
.toList();
|
.toList();
|
||||||
for (Integer subQuestId : subQuestIds) {
|
for (var subQuestId : subQuestIds) {
|
||||||
QuestData questConfig = GameData.getQuestDataMap().get(subQuestId);
|
QuestData questConfig = GameData.getQuestDataMap().get((int) subQuestId);
|
||||||
|
if (questConfig == null) {
|
||||||
|
Grasscutter.getLogger()
|
||||||
|
.error(
|
||||||
|
"Quest {} not found in QuestData. Please check MainQuestData and QuestData.",
|
||||||
|
subQuestId);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
this.childQuests.put(subQuestId, new GameQuest(this, questConfig));
|
this.childQuests.put(subQuestId, new GameQuest(this, questConfig));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user