Don't return completed main scenario quest

This commit is contained in:
Liza 2024-08-02 13:47:00 +02:00
parent 634ac804af
commit 0e0e74ce64
Signed by: liza
GPG Key ID: 7199F8D727D55F67

View File

@ -149,10 +149,7 @@ internal sealed unsafe class GameFunctions
// always prioritize accepting MSQ quests, to make sure we don't turn in one MSQ quest and then go off to do // always prioritize accepting MSQ quests, to make sure we don't turn in one MSQ quest and then go off to do
// side quests until the end of time. // side quests until the end of time.
var msqQuest = GetMainScenarioQuest(questManager); var msqQuest = GetMainScenarioQuest(questManager);
if (msqQuest.CurrentQuest != 0 && if (msqQuest.CurrentQuest != 0 && _questRegistry.IsKnownQuest(msqQuest.CurrentQuest))
_questRegistry.IsKnownQuest(msqQuest.CurrentQuest) &&
IsReadyToAcceptQuest(msqQuest.CurrentQuest) &&
!questManager->IsQuestAccepted(msqQuest.CurrentQuest))
return msqQuest; return msqQuest;
// 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, // 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,
@ -224,6 +221,11 @@ internal sealed unsafe class GameFunctions
if (questManager->IsQuestAccepted(currentQuest) && questManager->GetQuestById(currentQuest)->IsHidden) if (questManager->IsQuestAccepted(currentQuest) && questManager->GetQuestById(currentQuest)->IsHidden)
return default; return default;
// it can sometimes happen (although this isn't reliably reproducible) that the quest returned here
// is one you've just completed.
if (!IsReadyToAcceptQuest(currentQuest))
return default;
// if we're not at a high enough level to continue, we also ignore it // if we're not at a high enough level to continue, we also ignore it
var currentLevel = _clientState.LocalPlayer?.Level ?? 0; var currentLevel = _clientState.LocalPlayer?.Level ?? 0;
if (currentLevel != 0 && if (currentLevel != 0 &&