From ddea56e420eb262c9793eaa38406efe3fa1541c0 Mon Sep 17 00:00:00 2001 From: youqii Date: Thu, 26 Oct 2023 07:47:53 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=E6=88=90=E5=91=98=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp | 13 +++++++++---- src/MaaCore/Task/Miscellaneous/CreditFightTask.h | 5 ----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp b/src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp index bf3c5a0c6a..0de6335931 100644 --- a/src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/CreditFightTask.cpp @@ -20,12 +20,12 @@ asst::CreditFightTask::CreditFightTask(const AsstCallback& callback, Assistant* start_up_task_ptr->set_tasks({ "StageBegin" }).set_times_limit("GoLastBattle", 0); // 自动战斗 - m_copilot_params = json::object { + json::value copilot_params = json::object { { "filename", utils::path_to_utf8_string(ResDir.get() / "copilot" / "OF-1_credit_fight.json") }, { "formation", true }, { "support_unit_name", "_RANDOM_" }, }; - m_copilot_task_ptr->set_params(m_copilot_params); + m_copilot_task_ptr->set_params(copilot_params); // 关卡导航 stage_navigation_task_ptr->set_stage_name(m_copilot_task_ptr->get_stage_name()); @@ -45,6 +45,11 @@ asst::CreditFightTask::CreditFightTask(const AsstCallback& callback, Assistant* void asst::CreditFightTask::set_select_formation(int index) { - m_copilot_params["select_formation"] = index; - m_copilot_task_ptr->set_params(m_copilot_params); + json::value copilot_params = json::object{ + { "filename", utils::path_to_utf8_string(ResDir.get() / "copilot" / "OF-1_credit_fight.json") }, + { "formation", true }, + { "support_unit_name", "_RANDOM_" }, + { "select_formation", index }, + }; + m_copilot_task_ptr->set_params(copilot_params); } diff --git a/src/MaaCore/Task/Miscellaneous/CreditFightTask.h b/src/MaaCore/Task/Miscellaneous/CreditFightTask.h index 670f85bd3f..436a24b94d 100644 --- a/src/MaaCore/Task/Miscellaneous/CreditFightTask.h +++ b/src/MaaCore/Task/Miscellaneous/CreditFightTask.h @@ -21,10 +21,5 @@ namespace asst void set_select_formation(int index); private: std::shared_ptr m_copilot_task_ptr = nullptr; - json::value m_copilot_params = json::object { - { "filename", utils::path_to_utf8_string(ResDir.get() / "copilot" / "OF-1_credit_fight.json") }, - { "formation", true }, - { "support_unit_name", "_RANDOM_" }, - }; }; } // namespace asst