fix: 修复镜头切换带来的击杀数状态问题

This commit is contained in:
MistEO
2023-01-15 03:23:54 +08:00
parent 6553272d60
commit 388fa018ba
3 changed files with 14 additions and 10 deletions

View File

@@ -86,14 +86,13 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
LogTraceFunction;
if (init) {
wait_until_start();
wait_until_start(false);
}
cv::Mat image = init || reusable.empty() ? m_inst_helper.ctrler()->get_image() : reusable;
if (init) {
auto draw_future = std::async(std::launch::async, [&]() { save_map(image); });
update_kills(image);
}
BattleImageAnalyzer oper_analyzer(image);
@@ -219,11 +218,16 @@ bool asst::BattleHelper::update_deployment(bool init, const cv::Mat& reusable)
AvatarCache.set_avatar(name, oper.role, oper.avatar);
}
}
pause();
if (!unknown_opers.empty()) {
cancel_oper_selection();
}
image = m_inst_helper.ctrler()->get_image();
}
if (init) {
update_kills(image);
}
check_in_battle(image);
@@ -388,12 +392,12 @@ bool asst::BattleHelper::check_in_battle(const cv::Mat& reusable, bool weak)
{
cv::Mat image = reusable.empty() ? m_inst_helper.ctrler()->get_image() : reusable;
if (weak) {
m_in_battle = check_pause_button(image);
}
else {
BattleImageAnalyzer analyzer(image);
m_in_battle = analyzer.analyze();
}
else {
m_in_battle = check_pause_button(image);
}
return m_in_battle;
}
@@ -596,7 +600,7 @@ bool asst::BattleHelper::move_camera(const std::pair<double, double>& delta)
// 还没转场的时候
if (m_kills != 0) {
wait_until_end(true);
wait_until_end(false);
}
m_kills = 0;