From bb04991a116555eb833c1ba2ec6d6c21094205ee Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 6 Jun 2022 00:43:10 +0800 Subject: [PATCH] =?UTF-8?q?feat.=E8=87=AA=E5=8A=A8=E6=8A=84=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E7=9A=84=E4=BD=BF=E7=94=A8=E6=8A=80=E8=83=BD=E5=92=8C?= =?UTF-8?q?=E6=92=A4=E9=80=80=EF=BC=8C=E4=BC=98=E5=85=88=E6=8C=89=E5=9D=90?= =?UTF-8?q?=E6=A0=87=E8=BF=9B=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MeoAssistant/BattleProcessTask.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/MeoAssistant/BattleProcessTask.cpp b/src/MeoAssistant/BattleProcessTask.cpp index c1db41a417..5700373775 100644 --- a/src/MeoAssistant/BattleProcessTask.cpp +++ b/src/MeoAssistant/BattleProcessTask.cpp @@ -503,6 +503,7 @@ bool asst::BattleProcessTask::oper_retreat(const BattleAction& action) const std::string& name = m_group_to_oper_mapping[action.group_name].name; Point pos; if (auto iter = m_used_opers.find(name); + action.location.x != 0 && action.location.y != 0 && iter != m_used_opers.cend()) { pos = iter->second.pos; m_used_opers.erase(name); @@ -513,19 +514,23 @@ bool asst::BattleProcessTask::oper_retreat(const BattleAction& action) m_ctrler->click(pos); sleep(Task.get("BattleUseOper")->pre_delay); - return ProcessTask(*this, { "BattleOperRetreat" }).run(); + return ProcessTask(*this, { "BattleOperRetreat" }).set_task_delay(0).run(); } bool asst::BattleProcessTask::use_skill(const BattleAction& action) { const std::string& name = m_group_to_oper_mapping[action.group_name].name; - auto iter = m_used_opers.find(name); - if (iter == m_used_opers.cend()) { - Log.error(name, " not used"); - return false; + Point pos; + if (auto iter = m_used_opers.find(name); + action.location.x != 0 && action.location.y != 0 && + iter != m_used_opers.cend()) { + pos = iter->second.pos; + m_used_opers.erase(name); + } + else { + pos = m_normal_tile_info.at(action.location).pos; } - Point pos = iter->second.pos; m_ctrler->click(pos); sleep(Task.get("BattleUseOper")->pre_delay);