From 1012894eba4038e1cbe84e74428a63856222df26 Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 25 Aug 2022 22:25:07 -0400 Subject: [PATCH] fix: use correct agent --- TheHeartOfTheParty/GameFunctions.cs | 7 +++++-- TheHeartOfTheParty/Plugin.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TheHeartOfTheParty/GameFunctions.cs b/TheHeartOfTheParty/GameFunctions.cs index 77537f4..173f825 100755 --- a/TheHeartOfTheParty/GameFunctions.cs +++ b/TheHeartOfTheParty/GameFunctions.cs @@ -18,7 +18,10 @@ internal unsafe class GameFunctions { [Signature("48 8D 0D ?? ?? ?? ?? BD ?? ?? ?? ?? E8 ?? ?? ?? ?? 84 C0 75", ScanType = ScanType.StaticAddress)] private readonly IntPtr _titleList; - internal GameFunctions(Plugin plugin) { + [Signature("BA ?? ?? ?? ?? E8 ?? ?? ?? ?? 41 8B 4D 08", Offset = 1)] + private uint _agentId; + + internal GameFunctions() { SignatureHelper.Initialise(this); } @@ -39,7 +42,7 @@ internal unsafe class GameFunctions { } internal bool SetTitle(uint titleId) { - var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId((AgentId) 200); + var agent = Framework.Instance()->GetUiModule()->GetAgentModule()->GetAgentByInternalId((AgentId) this._agentId); if (agent == null) { return false; } diff --git a/TheHeartOfTheParty/Plugin.cs b/TheHeartOfTheParty/Plugin.cs index 8fac621..530ae1c 100755 --- a/TheHeartOfTheParty/Plugin.cs +++ b/TheHeartOfTheParty/Plugin.cs @@ -29,7 +29,7 @@ public class Plugin : IDalamudPlugin { public Plugin() { this.Config = this.Interface!.GetPluginConfig() as Configuration ?? new Configuration(); - this.Functions = new GameFunctions(this); + this.Functions = new GameFunctions(); this.Ui = new PluginUi(this); this.Commands = new Commands(this); }