diff --git a/resource/tasks.json b/resource/tasks.json index 5535a684b8..506661adfa 100644 --- a/resource/tasks.json +++ b/resource/tasks.json @@ -1906,7 +1906,7 @@ }, "InfrastSkills": { "template": "empty.png", - "templThreshold": 0.9, + "templThreshold": 0.85, "specialThreshold": 95, "specialThreshold_Doc": "用于做灰度图平均值", "rectMove_Doc": "基于笑脸的位置移动", diff --git a/src/MeoAssistant/InfrastOperImageAnalyzer.cpp b/src/MeoAssistant/InfrastOperImageAnalyzer.cpp index 94785275e4..3cfbc67fea 100644 --- a/src/MeoAssistant/InfrastOperImageAnalyzer.cpp +++ b/src/MeoAssistant/InfrastOperImageAnalyzer.cpp @@ -345,6 +345,7 @@ void asst::InfrastOperImageAnalyzer::skill_analyze() [](const auto& lhs, const auto& rhs) -> bool { return lhs.second.score < rhs.second.score; }); + double base_score = max_iter->second.score; std::string base_id = max_iter->first.id; size_t level_pos = 0; // 倒着找,第一个不是数字的。前面就是技能基础id名字,后面的数字就是技能等级 @@ -356,9 +357,13 @@ void asst::InfrastOperImageAnalyzer::skill_analyze() } base_id = base_id.substr(0, level_pos); std::string max_level; - for (const auto& [skill, _] : possible_skills) { + for (const auto& [skill, skill_mr] : possible_skills) { if (size_t find_pos = skill.id.find(base_id); find_pos != std::string::npos) { + // 得分差距过大的,直接忽略 + if (base_score - skill_mr.score > 0.5) { + continue; + } std::string cur_skill_level = skill.id.substr(base_id.size()); if (max_level.empty() || cur_skill_level > max_level) { max_level = cur_skill_level;