.Select(x =>
((ElementId?, byte)?)(x.Id, _questFunctions.GetQuestProgressInfo(x.Id)?.Sequence ?? 0))
.FirstOrDefault() ??
- _questFunctions.GetCurrentQuest();
+ _questFunctions.GetCurrentQuest(allowNewMsq: AutomationType != EAutomationType.SingleQuestB);
+
if (currentQuestId == null || currentQuestId.Value == 0)
{
if (_startedQuest != null)
{
questToRun.SetSequence(currentSequence);
CheckNextTasks(
- $"New sequence {questToRun == _startedQuest}/{_questFunctions.GetCurrentQuestInternal()}");
+ $"New sequence {questToRun == _startedQuest}/{_questFunctions.GetCurrentQuestInternal(true)}");
}
var q = questToRun.Quest;
_gameGui = gameGui;
}
- public (ElementId? CurrentQuest, byte Sequence) GetCurrentQuest()
+ public (ElementId? CurrentQuest, byte Sequence) GetCurrentQuest(bool allowNewMsq = true)
{
- var (currentQuest, sequence) = GetCurrentQuestInternal();
+ var (currentQuest, sequence) = GetCurrentQuestInternal(allowNewMsq);
PlayerState* playerState = PlayerState.Instance();
if (currentQuest == null || currentQuest.Value == 0)
return (currentQuest, sequence);
}
- public (ElementId? CurrentQuest, byte Sequence) GetCurrentQuestInternal()
+ public (ElementId? CurrentQuest, byte Sequence) GetCurrentQuestInternal(bool allowNewMsq)
{
var questManager = QuestManager.Instance();
if (questManager != null)
msqQuest = default;
if (msqQuest.CurrentQuest != null && !IsQuestAccepted(msqQuest.CurrentQuest))
- return msqQuest;
+ {
+ if (allowNewMsq)
+ return msqQuest;
+ else
+ msqQuest = default;
+ }
// Use the quests in the same order as they're shown in the to-do list, e.g. if the MSQ is the first item,
// do the MSQ; if a side quest is the first item do that side quest.