mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 22:17:22 +01:00
use index from gameobject to set set temp mods
This commit is contained in:
parent
814b24ebd8
commit
9a049c0d01
6 changed files with 23 additions and 73 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System.Text.Json;
|
||||
using Dalamud.Game.ClientState.Objects.Types;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace MareSynchronos.Utils;
|
||||
|
||||
|
|
@ -8,4 +9,14 @@ public static class VariousExtensions
|
|||
{
|
||||
return JsonSerializer.Deserialize<T>(JsonSerializer.Serialize(obj))!;
|
||||
}
|
||||
|
||||
public static unsafe int? ObjectTableIndex(this GameObject? gameObject)
|
||||
{
|
||||
if (gameObject == null || gameObject.Address == IntPtr.Zero)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return ((FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)gameObject.Address)->ObjectIndex;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue