diff --git a/Dalamud/Game/Gui/GameGui.cs b/Dalamud/Game/Gui/GameGui.cs
index ada9021c4..f19513a7f 100644
--- a/Dalamud/Game/Gui/GameGui.cs
+++ b/Dalamud/Game/Gui/GameGui.cs
@@ -1,5 +1,6 @@
using System.Runtime.InteropServices;
+using Dalamud.Game.Gui.NativeWrapper;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Hooking;
using Dalamud.Interface.Utility;
@@ -181,21 +182,21 @@ internal sealed unsafe class GameGui : IInternalDisposableService, IGameGui
}
///
- public IntPtr GetAddonByName(string name, int index = 1)
+ public AtkUnitBasePtr GetAddonByName(string name, int index = 1)
{
var atkStage = AtkStage.Instance();
if (atkStage == null)
- return IntPtr.Zero;
+ return 0;
var unitMgr = atkStage->RaptureAtkUnitManager;
if (unitMgr == null)
- return IntPtr.Zero;
+ return 0;
var addon = unitMgr->GetAddonByName(name, index);
if (addon == null)
- return IntPtr.Zero;
+ return 0;
- return (IntPtr)addon;
+ return (nint)addon;
}
///
@@ -458,7 +459,7 @@ internal class GameGuiPluginScoped : IInternalDisposableService, IGameGui
=> this.gameGuiService.GetUIModule();
///
- public IntPtr GetAddonByName(string name, int index = 1)
+ public AtkUnitBasePtr GetAddonByName(string name, int index = 1)
=> this.gameGuiService.GetAddonByName(name, index);
///
diff --git a/Dalamud/Plugin/Services/IGameGui.cs b/Dalamud/Plugin/Services/IGameGui.cs
index 0e2da7874..12f69a8f4 100644
--- a/Dalamud/Plugin/Services/IGameGui.cs
+++ b/Dalamud/Plugin/Services/IGameGui.cs
@@ -1,6 +1,7 @@
-using System.Numerics;
+using System.Numerics;
using Dalamud.Game.Gui;
+using Dalamud.Game.Gui.NativeWrapper;
using Dalamud.Game.Text.SeStringHandling.Payloads;
namespace Dalamud.Plugin.Services;
@@ -86,7 +87,7 @@ public unsafe interface IGameGui
/// Name of addon to find.
/// Index of addon to find (1-indexed).
/// nint.Zero if unable to find UI, otherwise nint pointing to the start of the addon.
- public nint GetAddonByName(string name, int index = 1);
+ public AtkUnitBasePtr GetAddonByName(string name, int index = 1);
///
/// Find the agent associated with an addon, if possible.