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); }