mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 17:57:01 +08:00
fix: 肉鸽宣告成功后闪退
This commit is contained in:
@@ -101,8 +101,7 @@ void asst::RoguelikeFoldartalUseTaskPlugin::use_enable_pair(std::vector<std::str
|
||||
if (need_exit()) {
|
||||
return;
|
||||
}
|
||||
auto iter_up = ranges::find(list, up_board);
|
||||
if (iter_up == list.end() || boards_to_skip.contains(up_board)) {
|
||||
if (auto iter_up = ranges::find(list, up_board); iter_up == list.end() || boards_to_skip.contains(up_board)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -111,8 +110,7 @@ void asst::RoguelikeFoldartalUseTaskPlugin::use_enable_pair(std::vector<std::str
|
||||
if (need_exit()) {
|
||||
return;
|
||||
}
|
||||
auto iter_down = ranges::find(list, down_board);
|
||||
if (iter_down == list.end() || boards_to_skip.contains(down_board)) {
|
||||
if (auto iter_down = ranges::find(list, down_board); iter_down == list.end() || boards_to_skip.contains(down_board)) {
|
||||
continue;
|
||||
}
|
||||
const auto result = use_board(up_board, down_board);
|
||||
@@ -138,7 +136,7 @@ void asst::RoguelikeFoldartalUseTaskPlugin::use_enable_pair(std::vector<std::str
|
||||
break;
|
||||
}
|
||||
if (result == UseBoardResult::UpBoardNotFound) {
|
||||
list.erase(iter_up);
|
||||
list.erase(ranges::find(list, up_board));
|
||||
Log.info("Up board not found! Delete up board:", up_board);
|
||||
break;
|
||||
}
|
||||
@@ -149,16 +147,16 @@ void asst::RoguelikeFoldartalUseTaskPlugin::use_enable_pair(std::vector<std::str
|
||||
continue;
|
||||
}
|
||||
if (result == UseBoardResult::DownBoardNotFound) {
|
||||
list.erase(iter_down);
|
||||
list.erase(ranges::find(list, down_board));
|
||||
Log.info("Down board not found! Delete down board:", down_board);
|
||||
continue;
|
||||
}
|
||||
// 正常使用板子,用完删除上板子和下板子
|
||||
if (result == UseBoardResult::UseBoardResultSuccess) {
|
||||
list.erase(iter_up);
|
||||
iter_down = ranges::find(list, down_board);
|
||||
list.erase(iter_down);
|
||||
list.erase(ranges::find(list, up_board));
|
||||
list.erase(ranges::find(list, down_board));
|
||||
Log.trace("Board pair used, up:", up_board, ", down:", down_board);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user