diff --git a/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs b/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs index 2251c2a85..b928ced49 100644 --- a/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs +++ b/Arrowgene.Ddon.GameServer/Handler/QuestSetPriorityQuestHandler.cs @@ -3,6 +3,7 @@ using Arrowgene.Ddon.Shared.Entity.PacketStructure; using Arrowgene.Ddon.Shared.Network; using Arrowgene.Logging; +using System.Reflection.Metadata.Ecma335; namespace Arrowgene.Ddon.GameServer.Handler { @@ -34,8 +35,26 @@ public override S2CQuestSetPriorityQuestRes Handle(GameClient client, C2SQuestSe } var quest = QuestManager.GetQuestByScheduleId(questScheduleId); + if (quest == null) + { + Logger.Error(client, $"No quest object exists for ${questScheduleId}"); + continue; + } + var questStateManager = QuestManager.GetQuestStateManager(client, quest); + if (questStateManager == null) + { + Logger.Error(client, $"Unable to fetch the quest state manager for ${questScheduleId}"); + continue; + } + var questState = questStateManager.GetQuestState(questScheduleId); + if (questState == null) + { + Logger.Error(client, $"Failed to find quest state for ${questScheduleId}"); + continue; + } + ntc.PriorityQuestList.Add(quest.ToCDataPriorityQuest(questState.Step)); }