From e98321337328aaf262c309a606db7d038322a0c3 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Mon, 28 Jul 2025 22:50:08 +0200 Subject: [PATCH] Reset quest state on logout --- Questionable/Controller/QuestController.cs | 28 +++++++++++++++------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Questionable/Controller/QuestController.cs b/Questionable/Controller/QuestController.cs index 7c52b732..a8024fbb 100644 --- a/Questionable/Controller/QuestController.cs +++ b/Questionable/Controller/QuestController.cs @@ -162,20 +162,25 @@ internal sealed class QuestController : MiniTaskController { _logger.LogInformation("Reload, resetting curent quest progress"); - _startedQuest = null; - _nextQuest = null; - _gatheringQuest = null; - _pendingQuest = null; - _simulatedQuest = null; - _safeAnimationEnd = DateTime.MinValue; - - DebugState = null; + ResetInternalState(); _questRegistry.Reload(); _singlePlayerDutyConfigComponent.Reload(); } } + private void ResetInternalState() + { + _startedQuest = null; + _nextQuest = null; + _gatheringQuest = null; + _pendingQuest = null; + _simulatedQuest = null; + _safeAnimationEnd = DateTime.MinValue; + + DebugState = null; + } + public void Update() { unsafe @@ -250,6 +255,13 @@ internal sealed class QuestController : MiniTaskController { DebugState = null; + if (!_clientState.IsLoggedIn) + { + ResetInternalState(); + DebugState = "Not logged in"; + return; + } + if (_pendingQuest != null) { if (!_questFunctions.IsQuestAccepted(_pendingQuest.Quest.Id)) -- 2.20.1