Merge pull request #3254 from MaaAssistantArknights/dev

Release v4.9.1 hotfix
This commit is contained in:
MistEO
2023-01-01 19:31:45 +08:00
committed by GitHub
2 changed files with 16 additions and 12 deletions

View File

@@ -1,3 +1,11 @@
## v4.9.1
- 修复 自动战斗 无法部署召唤物的问题 @MistEO
- 修复 自动战斗 CD 中干员识别错误导致反复点击的问题 @MistEO
- 修复 关卡导航 在高分辨率设置下滑动过头的问题 @MistEO
## v4.9.0
- 更新 `将进酒` 复刻活动数据,新增 活动关卡导航 @MistEO @ABA2396
- 重构 抄作业/肉鸽战斗 代码,新增干员头像缓存机制,优化 CD 中干员识别 @MistEO @ABA2396
- 移除 DX12 依赖,重新支持 Windows 7, Windows Server 等系统 @zhangchi0104 @MistEO

View File

@@ -138,18 +138,10 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
}
m_cur_deployment_opers.clear();
const double threshold = Task.get<MatchTaskInfo>("BattleAvatarData")->templ_threshold;
const double cooling_threshold = Task.get<MatchTaskInfo>("BattleAvatarCoolingData")->templ_threshold;
const auto& cooling_mask_range = Task.get<MatchTaskInfo>("BattleAvatarCoolingData")->mask_range;
auto cur_opers = oper_analyzer.get_opers();
std::vector<DeploymentOper> unknown_opers;
auto remove_cooling_from_battlefield = [&](const DeploymentOper& oper) {
if (!oper.cooling) {
return;
}
auto iter = m_battlefield_opers.find(oper.name);
if (iter == m_battlefield_opers.end()) {
return;
@@ -159,18 +151,22 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
m_battlefield_opers.erase(iter);
};
auto cur_opers = oper_analyzer.get_opers();
std::vector<DeploymentOper> unknown_opers;
for (auto& oper : cur_opers) {
MatchImageAnalyzer avatar_analyzer;
MatchImageAnalyzer avatar_analyzer(oper.avatar);
if (oper.cooling) {
Log.trace("start matching cooling", oper.index);
static const double cooling_threshold = Task.get<MatchTaskInfo>("BattleAvatarCoolingData")->templ_threshold;
static const auto cooling_mask_range = Task.get<MatchTaskInfo>("BattleAvatarCoolingData")->mask_range;
avatar_analyzer.set_threshold(cooling_threshold);
// 把环去掉
avatar_analyzer.set_mask_range(cooling_mask_range, true);
}
else {
static const double threshold = Task.get<MatchTaskInfo>("BattleAvatarData")->templ_threshold;
avatar_analyzer.set_threshold(threshold);
}
avatar_analyzer.set_image(oper.avatar);
double max_socre = 0;
for (const auto& [name, avatar] : m_all_deployment_avatars) {
@@ -184,7 +180,6 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
oper.name = name;
}
}
if (max_socre) {
m_cur_deployment_opers.insert_or_assign(oper.name, oper);
remove_cooling_from_battlefield(oper);
@@ -193,6 +188,7 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
Log.info("unknown oper", oper.index);
unknown_opers.emplace_back(oper);
}
if (oper.cooling) {
Log.trace("stop matching cooling", oper.index);
}