From e0b67b15231e649fe82195bd40644af55452bdcb Mon Sep 17 00:00:00 2001 From: uye <99072975+ABA2396@users.noreply.github.com> Date: Mon, 24 Nov 2025 12:57:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=A7=E6=8B=AC=E5=8F=B7=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Task/Miscellaneous/BattleProcessTask.cpp | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/MaaCore/Task/Miscellaneous/BattleProcessTask.cpp b/src/MaaCore/Task/Miscellaneous/BattleProcessTask.cpp index 93b8b704de..6937cc3860 100644 --- a/src/MaaCore/Task/Miscellaneous/BattleProcessTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/BattleProcessTask.cpp @@ -247,36 +247,36 @@ bool asst::BattleProcessTask::do_action(const battle::copilot::Action& action, s } break; - { - case ActionType::SkillUsage: - const auto set_usage = [this](const std::string& name, SkillUsage usage, int times) { - m_skill_usage[name] = usage; - if (usage == SkillUsage::Times) { - m_skill_times[name] = times; - } - }; - if (!location.empty()) { - std::string drone_name; - if (!name.empty()) { - LogWarn << "Both name and location are set for SkillUsage action. Skip this step."; - break; - } - if (auto it = m_used_tiles.find(location); it == m_used_tiles.end()) { - LogInfo << "Tile hasn't used, register for drone" << location; - drone_name = std::format("drone_{}_{}", location.x, location.y); - register_deployed_oper(drone_name, location); - } - else { - drone_name = it->second; - } - set_usage(drone_name, action.modify_usage, action.modify_times); + case ActionType::SkillUsage: + { + const auto set_usage = [this](const std::string& name, SkillUsage usage, int times) { + m_skill_usage[name] = usage; + if (usage == SkillUsage::Times) { + m_skill_times[name] = times; + } + }; + if (!location.empty()) { + std::string drone_name; + if (!name.empty()) { + LogWarn << "Both name and location are set for SkillUsage action. Skip this step."; + break; + } + if (auto it = m_used_tiles.find(location); it == m_used_tiles.end()) { + LogInfo << "Tile hasn't used, register for drone" << location; + drone_name = std::format("drone_{}_{}", location.x, location.y); + register_deployed_oper(drone_name, location); } else { - set_usage(name, action.modify_usage, action.modify_times); + drone_name = it->second; } - ret = true; - break; + set_usage(drone_name, action.modify_usage, action.modify_times); } + else { + set_usage(name, action.modify_usage, action.modify_times); + } + ret = true; + break; + } case ActionType::Output: // DoNothing