From: Liza Carvelli Date: Mon, 28 Jul 2025 20:50:08 +0000 (+0200) Subject: Reset quest state on logout X-Git-Tag: v6.0~19 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=e98321337328aaf262c309a606db7d038322a0c3;p=Questionable.git Reset quest state on logout --- 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))