From f446c8afdb923277b34d601f006e3a7edef6cb43 Mon Sep 17 00:00:00 2001 From: MistEO Date: Thu, 27 Oct 2022 10:42:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E6=A0=87=E5=BF=97=E4=BD=8D=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/2460 --- src/MeoAssistant/Assistant.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/MeoAssistant/Assistant.cpp b/src/MeoAssistant/Assistant.cpp index 176473f438..016d49a59a 100644 --- a/src/MeoAssistant/Assistant.cpp +++ b/src/MeoAssistant/Assistant.cpp @@ -266,7 +266,8 @@ void Assistant::working_proc() : (ret ? AsstMsg::TaskChainCompleted : AsstMsg::TaskChainError); task_callback(msg, callback_json, this); - if (!m_thread_idle) { + if (m_thread_idle) { + finished_tasks.clear(); continue; } @@ -276,7 +277,7 @@ void Assistant::working_proc() finished_tasks.clear(); } - auto delay = Configer.get_options().task_delay; + const int delay = Configer.get_options().task_delay; lock.lock(); m_condvar.wait_for(lock, std::chrono::milliseconds(delay), [&]() -> bool { return m_thread_idle; }); }