fix: 尝试修复外服肉鸽等级识别错误时不招人的问题

This commit is contained in:
MistEO
2022-10-22 20:59:51 +08:00
parent b478261fff
commit 031ebd6908
2 changed files with 4 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ bool asst::RoguelikeRecruitImageAnalyzer::analyze()
int elite = match_elite(rect);
int level = match_level(bbb_image, rect);
if (level == 0) {
if (level < 0) {
// 要么就是识别错了,要么这个干员希望不够,是灰色的
// 主要用于忽略后面灰色的这种情况
continue;
@@ -92,7 +92,7 @@ int asst::RoguelikeRecruitImageAnalyzer::match_level(const cv::Mat& image, const
analyzer.set_expansion(1);
if (!analyzer.analyze()) {
return 0;
return -1;
}
const std::string& level = analyzer.get_result().front().text;

View File

@@ -142,8 +142,9 @@ bool asst::RoguelikeRecruitTaskPlugin::_run()
priority = team_full_without_rookie ? recruit_info.recruit_priority_when_team_full
: recruit_info.recruit_priority;
}
else if (oper_info.elite == 1 && oper_info.level >= 50) {
else if (oper_info.elite == 1 && (oper_info.level >= 50 || oper_info.level == 0)) {
// 精一50级以上
// 等级是 0 一般是识别错了,多发生于外服,一般都是一错全错,先凑合着招一个吧,比不招人强 orz
priority = team_full_without_rookie ? recruit_info.recruit_priority_when_team_full
: recruit_info.recruit_priority;
}