use index from gameobject to set set temp mods
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user