From 1b1e0eaa045b7548e541b0e5d83815b7e73e2acf Mon Sep 17 00:00:00 2001 From: status102 Date: Sat, 23 Sep 2023 20:21:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E6=88=98=E6=96=97-?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=BC=96=E9=98=9F-=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E4=BD=8E=E4=BF=A1=E8=B5=96=E5=B9=B2=E5=91=98:=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E8=A1=A5=E5=85=85=E9=A1=BA=E5=BA=8F=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E5=9C=A8=E6=9E=81=E7=AB=AF=E6=83=85=E5=86=B5=E4=B8=8B?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Task/Miscellaneous/BattleFormationTask.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/MaaCore/Task/Miscellaneous/BattleFormationTask.cpp b/src/MaaCore/Task/Miscellaneous/BattleFormationTask.cpp index 2001befb92..9e6d8b8732 100644 --- a/src/MaaCore/Task/Miscellaneous/BattleFormationTask.cpp +++ b/src/MaaCore/Task/Miscellaneous/BattleFormationTask.cpp @@ -205,15 +205,21 @@ bool asst::BattleFormationTask::add_trust_operators() } else { failed_count = 0; - for (const auto& trust_icon : matcher.get_result()) { + std::vector result = matcher.get_result(); + // 按先上下后左右排个序 + sort_by_vertical_(result); + for (const auto& trust_icon : result) { // 匹配完干员左下角信赖表,将roi偏移到整个干员标 ctrler()->click(trust_icon.rect.move({ 20, -225, 110, 250 })); - if (--append_count <= 0 || need_exit()) { + --append_count; + if (append_count <= 0 || need_exit()) { break; } } } - swipe_page(); + if (!need_exit() && append_count > 0) { + swipe_page(); + } } return append_count == 0;