Skip to content

Commit

Permalink
fix: 修复 wait_freezes timeout 不生效
Browse files Browse the repository at this point in the history
fix #538
  • Loading branch information
MistEO committed Feb 17, 2025
1 parent fb0241d commit c58e5b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/MaaFramework/Task/Component/Actuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ void Actuator::wait_freezes(const MAA_RES_NS::WaitFreezesParam& param, const cv:
LogDebug << "sleep_until" << VAR(rate_limit);
std::this_thread::sleep_until(screencap_clock + rate_limit);

if (duration_since(start_clock) > param.timeout) {
LogError << "Wait freezes timeout" << VAR(duration_since(start_clock)) << VAR(param.timeout);
break;
}

screencap_clock = std::chrono::steady_clock::now();
cv::Mat cur_image = controller()->screencap();

Expand All @@ -197,11 +202,6 @@ void Actuator::wait_freezes(const MAA_RES_NS::WaitFreezesParam& param, const cv:
if (duration_since(pre_image_clock) > param.time) {
break;
}

if (duration_since(start_clock) > param.timeout) {
LogError << "Wait freezes timeout" << VAR(duration_since(start_clock)) << VAR(param.timeout);
break;
}
}
}

Expand Down

0 comments on commit c58e5b3

Please sign in to comment.