Stop AD when questionable is currently running an AD dungeon/trial
This commit is contained in:
parent
21721e34b4
commit
48cc37dd05
@ -473,6 +473,9 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||
private void ClearTasksInternal()
|
||||
{
|
||||
//_logger.LogDebug("Clearing task (internally)");
|
||||
if (_taskQueue.CurrentTaskExecutor is IStoppableTaskExecutor stoppableTaskExecutor)
|
||||
stoppableTaskExecutor.StopNow();
|
||||
|
||||
_taskQueue.Reset();
|
||||
|
||||
_yesAlreadyIpc.RestoreYesAlready();
|
||||
|
@ -49,7 +49,7 @@ internal static class Duty
|
||||
TerritoryData territoryData,
|
||||
IClientState clientState,
|
||||
IChatGui chatGui,
|
||||
SendNotification.Executor sendNotificationExecutor) : TaskExecutor<StartAutoDutyTask>
|
||||
SendNotification.Executor sendNotificationExecutor) : TaskExecutor<StartAutoDutyTask>, IStoppableTaskExecutor
|
||||
{
|
||||
protected override bool Start()
|
||||
{
|
||||
@ -94,6 +94,8 @@ internal static class Duty
|
||||
: ETaskResult.StillRunning;
|
||||
}
|
||||
|
||||
public void StopNow() => autoDutyIpc.Stop();
|
||||
|
||||
public override bool ShouldInterruptOnDamage() => false;
|
||||
}
|
||||
|
||||
@ -105,7 +107,7 @@ internal static class Duty
|
||||
internal sealed class WaitAutoDutyExecutor(
|
||||
AutoDutyIpc autoDutyIpc,
|
||||
TerritoryData territoryData,
|
||||
IClientState clientState) : TaskExecutor<WaitAutoDutyTask>
|
||||
IClientState clientState) : TaskExecutor<WaitAutoDutyTask>, IStoppableTaskExecutor
|
||||
{
|
||||
protected override bool Start() => true;
|
||||
|
||||
@ -120,6 +122,8 @@ internal static class Duty
|
||||
: ETaskResult.StillRunning;
|
||||
}
|
||||
|
||||
public void StopNow() => autoDutyIpc.Stop();
|
||||
|
||||
public override bool ShouldInterruptOnDamage() => false;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,11 @@ internal interface IExtraTaskCreator : ITaskExecutor
|
||||
IEnumerable<ITask> CreateExtraTasks();
|
||||
}
|
||||
|
||||
internal interface IStoppableTaskExecutor : ITaskExecutor
|
||||
{
|
||||
void StopNow();
|
||||
}
|
||||
|
||||
internal abstract class TaskExecutor<T> : ITaskExecutor
|
||||
where T : class, ITask
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user