mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 01:52:58 +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())
|
||||
.map(SubQuestData::getSubId)
|
||||
.toList();
|
||||
for (Integer subQuestId : subQuestIds) {
|
||||
QuestData questConfig = GameData.getQuestDataMap().get(subQuestId);
|
||||
for (var subQuestId : subQuestIds) {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user