mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-18 02:10:21 +08:00
perf.简单优化了一点自动战斗的逻辑,盐风溶洞 30 写了一半摆烂了
This commit is contained in:
@@ -318,11 +318,12 @@ bool asst::BattleProcessTask::do_action(const BattleAction& action)
|
||||
|
||||
bool asst::BattleProcessTask::wait_condition(const BattleAction& action)
|
||||
{
|
||||
cv::Mat image;
|
||||
while (m_kills < action.kills) {
|
||||
if (need_exit()) {
|
||||
return false;
|
||||
}
|
||||
const auto& image = m_ctrler->get_image();
|
||||
image = m_ctrler->get_image();
|
||||
BattleImageAnalyzer analyzer(image);
|
||||
|
||||
analyzer.set_target(BattleImageAnalyzer::Target::Kills);
|
||||
@@ -344,7 +345,7 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action)
|
||||
if (need_exit()) {
|
||||
return false;
|
||||
}
|
||||
const auto& image = m_ctrler->get_image();
|
||||
image = m_ctrler->get_image();
|
||||
update_opers_info(image);
|
||||
|
||||
if (auto iter = m_cur_opers_info.find(name);
|
||||
@@ -356,6 +357,10 @@ bool asst::BattleProcessTask::wait_condition(const BattleAction& action)
|
||||
std::this_thread::yield();
|
||||
};
|
||||
}
|
||||
if (image.empty()) {
|
||||
image = m_ctrler->get_image();
|
||||
try_possible_skill(image);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user