From 60e69f5b8dccb55eb1e34a778a99a042f0165c18 Mon Sep 17 00:00:00 2001 From: Ethan Moffat Date: Wed, 6 Apr 2022 23:00:08 -0700 Subject: [PATCH] Fix bug where quest NPC dialog caused a crash because the requested NPC was never set --- EOLib/Domain/Interact/MapNPCActions.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/EOLib/Domain/Interact/MapNPCActions.cs b/EOLib/Domain/Interact/MapNPCActions.cs index 4eafbf762..ad7f3a441 100644 --- a/EOLib/Domain/Interact/MapNPCActions.cs +++ b/EOLib/Domain/Interact/MapNPCActions.cs @@ -1,4 +1,5 @@ using AutomaticTypeMapper; +using EOLib.Domain.Interact.Quest; using EOLib.Domain.NPC; using EOLib.IO.Repositories; using EOLib.Net; @@ -11,12 +12,15 @@ public class MapNPCActions : IMapNPCActions { private readonly IPacketSendService _packetSendService; private readonly IENFFileProvider _enfFileProvider; + private readonly IQuestDataRepository _questDataRepository; public MapNPCActions(IPacketSendService packetSendService, - IENFFileProvider enfFileProvider) + IENFFileProvider enfFileProvider, + IQuestDataRepository questDataRepository) { _packetSendService = packetSendService; _enfFileProvider = enfFileProvider; + _questDataRepository = questDataRepository; } public void RequestShop(INPC npc) @@ -30,6 +34,8 @@ public void RequestShop(INPC npc) public void RequestQuest(INPC npc) { + _questDataRepository.RequestedNPC = npc; + var data = _enfFileProvider.ENFFile[npc.ID]; var packet = new PacketBuilder(PacketFamily.Quest, PacketAction.Use)