From 1bb121d39387e8c4e9ec58942342dc0d3b341f4a Mon Sep 17 00:00:00 2001 From: status102 Date: Mon, 4 Sep 2023 12:00:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E4=B8=8B=E6=A0=87=E8=B6=8A=E7=95=8C?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E8=AF=86=E5=88=AB=E7=BB=93=E6=9E=9C=E5=88=86?= =?UTF-8?q?=E5=9D=97=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaCore/Task/Fight/SanityBeforeStagePlugin.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/MaaCore/Task/Fight/SanityBeforeStagePlugin.cpp b/src/MaaCore/Task/Fight/SanityBeforeStagePlugin.cpp index 95c0ffea14..0749f83319 100644 --- a/src/MaaCore/Task/Fight/SanityBeforeStagePlugin.cpp +++ b/src/MaaCore/Task/Fight/SanityBeforeStagePlugin.cpp @@ -48,13 +48,14 @@ void asst::SanityBeforeStagePlugin::get_sanity() Log.info("__FUNCTION__", "Current Sanity analyze failed"); return; } - auto text = analyzer.get_result().front().text; + auto result = analyzer.get_result(); + auto text = std::string(""); + for (auto it = result.begin(); it != result.end(); it++) { + text = text + it->text; + } Log.info("__FUNCTION__", "Current Sanity:" + text); - if (!text.find('/')) { - if (text.ends_with(' ')) { - text = text.substr(0, text.find_last_not_of(' ') + 1); - } + if (!text.find('/') && text.length() > 3) { if (text[text.length() - 3] == '1' && text[text.length() - 2] <= '3') { text = text.substr(0, text.length() - 3) + '/' + text.substr(text.length() - 3); }