fix: 修复多次调用AsstStart的问题

This commit is contained in:
MistEO
2023-06-29 23:22:23 +08:00
parent 8277fba8ee
commit dbfa616f51
2 changed files with 10 additions and 5 deletions

View File

@@ -1381,16 +1381,21 @@ namespace MaaWpfGui.Main
return id != 0;
}
public bool AsstAppendCloseDown()
{
AsstStop();
AsstTaskId id = AsstAppendTaskWithEncoding("CloseDown");
_latestTaskId[TaskType.CloseDown] = id;
return id != 0;
}
/// <summary>
/// <c>CloseDown</c> 任务。
/// </summary>
/// <returns>是否成功。</returns>
public bool AsstStartCloseDown()
{
AsstStop();
AsstTaskId id = AsstAppendTaskWithEncoding("CloseDown");
_latestTaskId[TaskType.CloseDown] = id;
return id != 0 && AsstStart();
return AsstAppendCloseDown() && AsstStart();
}
/// <summary>

View File

@@ -269,7 +269,7 @@ namespace MaaWpfGui.ViewModels.UI
count++;
}
if (!Instances.AsstProxy.AsstStartCloseDown())
if (!Instances.AsstProxy.AsstAppendCloseDown())
{
AddLog(LocalizationHelper.GetString("CloseArknightsFailed"), UiLogColor.Error);
}