From 08b715a8eb57a4cc61010e87ec2d5100b42045f1 Mon Sep 17 00:00:00 2001 From: status102 <102887808+status102@users.noreply.github.com> Date: Mon, 28 Oct 2024 14:24:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=82=80=E5=BD=B1=E8=82=89=E9=B8=BD?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=BD=9C=E5=9C=A8=E7=9A=84=E5=B9=B2=E5=91=98?= =?UTF-8?q?=E6=8B=9B=E5=8B=9F=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E6=B7=BB=E5=8A=A0=E9=9A=BE=E5=BA=A6=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Task/Roguelike/RoguelikeConfig.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/MaaCore/Task/Roguelike/RoguelikeConfig.cpp b/src/MaaCore/Task/Roguelike/RoguelikeConfig.cpp index b9a045c6ff..8e86800cd8 100644 --- a/src/MaaCore/Task/Roguelike/RoguelikeConfig.cpp +++ b/src/MaaCore/Task/Roguelike/RoguelikeConfig.cpp @@ -20,7 +20,17 @@ bool asst::RoguelikeConfig::verify_and_load_params(const json::value& params) m_theme = theme; m_mode = mode; - m_difficulty = params.get("difficulty", 0); + + if (m_theme != RoguelikeTheme::Phantom) { + m_difficulty = params.get("difficulty", 0); + } + else if (params.contains("difficulty")) { + Log.error(__FUNCTION__, "| Invalid difficulty for theme", m_theme); + return false; + } + else { + m_difficulty = 1; + } m_start_with_elite_two = params.get("start_with_elite_two", false); m_only_start_with_elite_two = params.get("only_start_with_elite_two", false);