From 847270cd7849012eb3df9be27da8eed8d11e6f0f Mon Sep 17 00:00:00 2001 From: MistEO Date: Sun, 24 Jul 2022 16:51:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=88=98=E6=96=97=E5=9C=A8=E5=B9=B2=E5=91=98=E8=BF=87=E5=A4=9A?= =?UTF-8?q?=EF=BC=8814=E4=B8=AA=E5=8F=8A=E4=BB=A5=E4=B8=8A=EF=BC=89?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=B4=A9=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix https://github.com/MaaAssistantArknights/MaaAssistantArknights/issues/1122 --- src/MeoAssistant/BattleImageAnalyzer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MeoAssistant/BattleImageAnalyzer.cpp b/src/MeoAssistant/BattleImageAnalyzer.cpp index c16ca1f49f..025ea258fd 100644 --- a/src/MeoAssistant/BattleImageAnalyzer.cpp +++ b/src/MeoAssistant/BattleImageAnalyzer.cpp @@ -132,6 +132,9 @@ bool asst::BattleImageAnalyzer::opers_analyze() for (const MatchRect& flag_mrect : flags_analyzer.get_result()) { BattleRealTimeOper oper; oper.rect = flag_mrect.rect.move(click_move); + if (oper.rect.x + oper.rect.width >= m_image.cols) { + oper.rect.width = m_image.cols - oper.rect.x; + } oper.avatar = m_image(utils::make_rect(oper.rect)); Rect available_rect = flag_mrect.rect.move(avlb_move); @@ -147,6 +150,9 @@ bool asst::BattleImageAnalyzer::opers_analyze() #endif Rect cooling_rect = flag_mrect.rect.move(cooling_move); + if (cooling_rect.x + cooling_rect.width >= m_image.cols) { + cooling_rect.width = m_image.cols - cooling_rect.x; + } oper.cooling = oper_cooling_analyze(cooling_rect); if (oper.cooling && oper.available) { Log.error("oper is available, but with cooling");