Add check for scripts before quests are enabled

This commit is contained in:
KingRainbow44 2023-05-04 00:06:54 -04:00
parent 2c55b5b3da
commit 2d12e0a4d9
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -29,6 +29,7 @@ import java.util.stream.Collectors;
import static emu.grasscutter.GameConstants.DEBUG; import static emu.grasscutter.GameConstants.DEBUG;
import static emu.grasscutter.config.Configuration.GAME_OPTIONS; import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
import static emu.grasscutter.config.Configuration.SERVER;
public class QuestManager extends BasePlayerManager { public class QuestManager extends BasePlayerManager {
@Getter private final Player player; @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() { 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; return GAME_OPTIONS.questing.enabled;
} }