mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 18:20:39 +08:00
fix.修复一个傻逼识别bug
This commit is contained in:
@@ -445,7 +445,10 @@ bool asst::InfrastProductionTask::optimal_calc()
|
||||
bool asst::InfrastProductionTask::opers_choose()
|
||||
{
|
||||
LogTraceFunction;
|
||||
bool has_error = false;
|
||||
bool has_error = false;
|
||||
auto& facility_info = Resrc.infrast().get_facility_info(m_facility);
|
||||
int cur_max_num_of_opers = facility_info.max_num_of_opers - m_cur_num_of_lokced_opers;
|
||||
|
||||
while (true) {
|
||||
if (need_exit()) {
|
||||
return false;
|
||||
@@ -479,7 +482,9 @@ bool asst::InfrastProductionTask::opers_choose()
|
||||
[&](const infrast::Oper& rhs) -> bool {
|
||||
return rhs.mood_ratio < m_mood_threshold;
|
||||
});
|
||||
cur_all_opers.erase(remove_iter, cur_all_opers.end());
|
||||
cur_all_opers.erase(remove_iter, cur_all_opers.end());
|
||||
|
||||
int count = 0;
|
||||
for (auto opt_iter = m_optimal_combs.begin(); opt_iter != m_optimal_combs.end();) {
|
||||
auto find_iter = std::find_if(
|
||||
cur_all_opers.cbegin(), cur_all_opers.cend(),
|
||||
@@ -509,8 +514,6 @@ bool asst::InfrastProductionTask::opers_choose()
|
||||
}
|
||||
// 这种情况可能是需要选择两个同样的技能,上一次循环选了一个,但是没有把滑出当前页面,本次又识别到了这个已选择的人
|
||||
if (find_iter->selected == true) {
|
||||
auto& facility_info = Resrc.infrast().get_facility_info(m_facility);
|
||||
int cur_max_num_of_opers = facility_info.max_num_of_opers - m_cur_num_of_lokced_opers;
|
||||
if (cur_max_num_of_opers != 1) {
|
||||
cur_all_opers.erase(find_iter);
|
||||
continue;
|
||||
@@ -538,12 +541,17 @@ bool asst::InfrastProductionTask::opers_choose()
|
||||
else {
|
||||
Log.error("opers_choose | not found oper");
|
||||
}
|
||||
}
|
||||
}
|
||||
++count;
|
||||
cur_all_opers.erase(find_iter);
|
||||
opt_iter = m_optimal_combs.erase(opt_iter);
|
||||
}
|
||||
if (m_optimal_combs.empty()) {
|
||||
break;
|
||||
if (m_optimal_combs.empty()) {
|
||||
if (count >= cur_max_num_of_opers) {
|
||||
break;
|
||||
}
|
||||
else { // 这种情况可能是萌新,可用干员人数不足以填满当前设施
|
||||
}
|
||||
}
|
||||
|
||||
// 因为识别完了还要点击,所以这里不能异步滑动
|
||||
@@ -611,4 +619,4 @@ bool asst::InfrastProductionTask::facility_list_detect()
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ bool asst::MatchImageAnalyzer::analyze()
|
||||
Log.error("templ is empty!");
|
||||
return false;
|
||||
}
|
||||
match_templ(templ);
|
||||
return match_templ(templ);
|
||||
}
|
||||
|
||||
bool asst::MatchImageAnalyzer::match_templ(const cv::Mat& templ)
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
namespace asst
|
||||
{
|
||||
constexpr static const char* Version = "v2.3.0";
|
||||
constexpr static const char* Version = "v2.3.1";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user