diff --git a/resource/tasks.json b/resource/tasks.json index 9bd1c8f0c3..6312fe2d29 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -4706,11 +4706,7 @@ "TaskSami.png" ], "cache": false, - "templThreshold": [ - 0.7, - 0.7, - 0.7 - ], + "templThreshold": 0.7, "action": "ClickSelf", "roi": [ 700, @@ -4909,11 +4905,7 @@ "FriendsSami.png" ], "cache": false, - "templThreshold": [ - 0.7, - 0.7, - 0.7 - ], + "templThreshold": 0.7, "action": "ClickSelf", "roi": [ 250, diff --git a/src/MaaCore/Config/TaskData.cpp b/src/MaaCore/Config/TaskData.cpp index 0b7e00056f..06524d644b 100644 --- a/src/MaaCore/Config/TaskData.cpp +++ b/src/MaaCore/Config/TaskData.cpp @@ -776,7 +776,9 @@ asst::TaskData::taskptr_t asst::TaskData::generate_match_task_info(std::string_v default_ptr->templ_thresholds.back()); } else if (threshold_opt->is_number()) { - match_task_info_ptr->templ_thresholds = { threshold_opt->as_double() }; + // 单个数值时,所有模板都使用这个阈值 + match_task_info_ptr->templ_thresholds.resize(match_task_info_ptr->templ_names.size(), + threshold_opt->as_double()); } else if (threshold_opt->is_array()) { ranges::copy(threshold_opt->as_array() | views::transform(&ranges::range_value_t::as_double),