From 25c72a19e08eafe22ced4575e9297c6c701233e7 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Mon, 24 Apr 2023 03:10:22 -0400 Subject: [PATCH] Fix main quest data loading issue --- .../emu/grasscutter/data/binout/MainQuestData.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/emu/grasscutter/data/binout/MainQuestData.java b/src/main/java/emu/grasscutter/data/binout/MainQuestData.java index b14521b0b..1eb98318a 100644 --- a/src/main/java/emu/grasscutter/data/binout/MainQuestData.java +++ b/src/main/java/emu/grasscutter/data/binout/MainQuestData.java @@ -2,9 +2,9 @@ package emu.grasscutter.data.binout; import dev.morphia.annotations.Entity; import emu.grasscutter.data.GameData; -import emu.grasscutter.data.excels.QuestData; import emu.grasscutter.game.quest.enums.QuestType; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -58,9 +58,11 @@ public class MainQuestData { } public void onLoad() { - if (this.talks != null) - this.talks = this.talks.stream() - .filter(Objects::nonNull).toList(); + if (this.talks == null) this.talks = new ArrayList<>(); + if (this.subQuests == null) this.subQuests = new SubQuestData[0]; + + this.talks = this.talks.stream() + .filter(Objects::nonNull).toList(); Arrays.stream(this.subQuests).forEach(quest -> { var questData = GameData.getQuestDataMap().get(quest.getSubId()); if (questData != null) questData.applyFrom(quest);