From 924fc64302cbf4e7f1b5c7ae6cc971ebeb43b04e Mon Sep 17 00:00:00 2001 From: MistEO Date: Wed, 24 May 2023 00:32:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E5=B9=B2=E5=91=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Controller/MinitouchController.cpp | 2 +- src/MaaCore/Task/BattleHelper.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MaaCore/Controller/MinitouchController.cpp b/src/MaaCore/Controller/MinitouchController.cpp index e1dd3da803..3fccbf56bf 100644 --- a/src/MaaCore/Controller/MinitouchController.cpp +++ b/src/MaaCore/Controller/MinitouchController.cpp @@ -149,7 +149,6 @@ bool asst::MinitouchController::swipe(const Point& p1, const Point& p2, int dura y1 = std::clamp(y1, 0, m_height - 1); } - const auto& opt = Config.get_options(); Log.trace(m_use_maa_touch ? "maatouch" : "minitouch", "swipe", p1, p2, duration, extra_swipe, slope_in, slope_out); m_minitoucher->down(x1, y1); @@ -163,6 +162,7 @@ bool asst::MinitouchController::swipe(const Point& p1, const Point& p2, int dura }; // TODO: move this to math.hpp bool need_pause = with_pause && use_swipe_with_pause(); + const auto& opt = Config.get_options(); std::future pause_future; auto minitouch_move = [&](int _x1, int _y1, int _x2, int _y2, int _duration) { for (int cur_time = TimeInterval; cur_time < _duration; cur_time += TimeInterval) { diff --git a/src/MaaCore/Task/BattleHelper.cpp b/src/MaaCore/Task/BattleHelper.cpp index a76f221fe0..d4dd1f590f 100644 --- a/src/MaaCore/Task/BattleHelper.cpp +++ b/src/MaaCore/Task/BattleHelper.cpp @@ -282,8 +282,8 @@ bool asst::BattleHelper::deploy_oper(const std::string& name, const Point& loc, } bool deploy_with_pause = ControlFeat::support(m_inst_helper.ctrler()->support_features(), ControlFeat::SWIPE_WITH_PAUSE); - m_inst_helper.ctrler()->swipe(Point(oper_rect.x, oper_rect.y), Point(target_point.x, target_point.y), duration, - false, swipe_oper_task_ptr->special_params.at(1), + Point oper_point(oper_rect.x + oper_rect.width / 2, oper_rect.y + oper_rect.height / 2); + m_inst_helper.ctrler()->swipe(oper_point, target_point, duration, false, swipe_oper_task_ptr->special_params.at(1), swipe_oper_task_ptr->special_params.at(2), deploy_with_pause); // 拖动干员朝向