From b362fbfcf02f6ff7cbfce640f1d1dcc93a94c6ab Mon Sep 17 00:00:00 2001 From: uye <2396806385@qq.com> Date: Sat, 29 Apr 2023 23:24:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=BF=E7=81=AD?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E4=BB=BB=E5=8A=A1=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=97=B6=E5=A4=87=E9=80=89=E5=85=B3=E5=8D=A1=E4=B8=BA=E6=9C=AA?= =?UTF-8?q?=E5=9C=A8=E5=88=97=E8=A1=A8=E7=9A=84=E4=B8=BB=E7=BA=BF=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=E8=A2=AB=E8=B7=B3=E8=BF=87=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #4543 --- src/MaaWpfGui/Services/StageManager.cs | 1 + src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MaaWpfGui/Services/StageManager.cs b/src/MaaWpfGui/Services/StageManager.cs index 9aa2cf7882..8233efaaff 100644 --- a/src/MaaWpfGui/Services/StageManager.cs +++ b/src/MaaWpfGui/Services/StageManager.cs @@ -323,6 +323,7 @@ namespace MaaWpfGui.Services public StageInfo GetStageInfo(string stage) { _stages.TryGetValue(stage, out var stageInfo); + stageInfo ??= new StageInfo { Display = stage, Value = stage }; return stageInfo; } diff --git a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs index 20c4165f25..55f7a7e4de 100644 --- a/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/TaskQueueViewModel.cs @@ -840,13 +840,15 @@ namespace MaaWpfGui.ViewModels.UI } } - bool mainFightRet = Instances.AsstProxy.AsstAppendFight(Stage, medicine, stone, times, DropsItemId, drops_quantity); + string curStage = Stage; - if (mainFightRet && (Stage == "Annihilation") && Instances.SettingsViewModel.UseAlternateStage) + bool mainFightRet = Instances.AsstProxy.AsstAppendFight(curStage, medicine, stone, times, DropsItemId, drops_quantity); + + if (mainFightRet && (curStage == "Annihilation") && Instances.SettingsViewModel.UseAlternateStage) { foreach (var stage in new[] { Stage1, Stage2, Stage3 }) { - if (IsStageOpen(stage) && (stage != Stage)) + if (IsStageOpen(stage) && (stage != curStage)) { mainFightRet = Instances.AsstProxy.AsstAppendFight(stage, medicine, 0, int.MaxValue, string.Empty, 0); }