Skip to content

Commit

Permalink
Fix bug where quest NPC dialog caused a crash because the requested N…
Browse files Browse the repository at this point in the history
…PC was never set
  • Loading branch information
ethanmoffat committed Apr 7, 2022
1 parent 4037a11 commit 60e69f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion 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;
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 60e69f5

Please sign in to comment.