From 2d12e0a4d90de518c1c6df508cd610f88d6e798c Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Thu, 4 May 2023 00:06:54 -0400 Subject: [PATCH] Add check for scripts before quests are enabled --- .../java/emu/grasscutter/game/quest/QuestManager.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/game/quest/QuestManager.java b/src/main/java/emu/grasscutter/game/quest/QuestManager.java index 7a2efdbc9..1de65b7c5 100644 --- a/src/main/java/emu/grasscutter/game/quest/QuestManager.java +++ b/src/main/java/emu/grasscutter/game/quest/QuestManager.java @@ -29,6 +29,7 @@ import java.util.stream.Collectors; import static emu.grasscutter.GameConstants.DEBUG; import static emu.grasscutter.config.Configuration.GAME_OPTIONS; +import static emu.grasscutter.config.Configuration.SERVER; public class QuestManager extends BasePlayerManager { @Getter private final Player player; @@ -115,8 +116,16 @@ public class QuestManager extends BasePlayerManager { } } - // TODO store user value set on enable + /** + * Checks if questing can be enabled. + */ public boolean isQuestingEnabled() { + // Check if scripts are enabled. + if (!SERVER.game.enableScriptInBigWorld) { + Grasscutter.getLogger().warn("Questing is disabled without scripts enabled."); + return false; + } + return GAME_OPTIONS.questing.enabled; }