fix: 大括号位置错误

This commit is contained in:
uye
2025-11-24 12:57:35 +08:00
parent 31520afb37
commit e0b67b1523

View File

@@ -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