From 4ee1057591fc117374130ed33ad7b60a3e93663c Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Sat, 29 May 2021 01:22:31 -0400 Subject: [PATCH] fix(pf): register listing event correctly --- XivCommon/Functions/PartyFinder.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/XivCommon/Functions/PartyFinder.cs b/XivCommon/Functions/PartyFinder.cs index ec42387..ec5a48a 100755 --- a/XivCommon/Functions/PartyFinder.cs +++ b/XivCommon/Functions/PartyFinder.cs @@ -5,7 +5,6 @@ using Dalamud.Game; using Dalamud.Game.Internal.Gui; using Dalamud.Game.Internal.Gui.Structs; using Dalamud.Hooking; -using Dalamud.Plugin; namespace XivCommon.Functions { /// @@ -66,6 +65,10 @@ namespace XivCommon.Functions { this.ListingsEnabled = hooks.HasFlag(Hooks.PartyFinderListings); this.JoinsEnabled = hooks.HasFlag(Hooks.PartyFinderJoins); + if (this.ListingsEnabled || this.JoinsEnabled) { + this.PartyFinderGui.ReceiveListing += this.ReceiveListing; + } + if (scanner.TryScanText(Signatures.RequestListings, out var requestPfPtr, "Party Finder listings")) { this.RequestPartyFinderListings = Marshal.GetDelegateForFunctionPointer(requestPfPtr); @@ -78,8 +81,6 @@ namespace XivCommon.Functions { if (this.JoinsEnabled && scanner.TryScanText(Signatures.JoinCrossParty, out var joinPtr, "Party Finder joins")) { this.JoinPfHook = new Hook(joinPtr, new JoinPfDelegate(this.JoinPfDetour)); this.JoinPfHook.Enable(); - - this.PartyFinderGui.ReceiveListing += this.ReceiveListing; } }