From 7baccdcdc9ac480246d20c8c14dcffd2d2eaefb4 Mon Sep 17 00:00:00 2001 From: Asgard <95163444+AsgardXIV@users.noreply.github.com> Date: Sun, 22 Jan 2023 17:57:55 -0700 Subject: [PATCH] GameObject reference conversions --- Dalamud/Game/ClientState/Objects/Enums/ObjectKind.cs | 5 +++++ Dalamud/Game/ClientState/Objects/ObjectTable.cs | 4 ++++ Dalamud/Game/ClientState/Objects/Types/GameObject.cs | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/Dalamud/Game/ClientState/Objects/Enums/ObjectKind.cs b/Dalamud/Game/ClientState/Objects/Enums/ObjectKind.cs index 6bfb80863..e60ecaff5 100644 --- a/Dalamud/Game/ClientState/Objects/Enums/ObjectKind.cs +++ b/Dalamud/Game/ClientState/Objects/Enums/ObjectKind.cs @@ -79,4 +79,9 @@ public enum ObjectKind : byte /// Objects representing card stand objects. /// CardStand = 0x0E, + + /// + /// Objects representing ornament (Fashion Accessories) objects. + /// + Ornament = 0x0F, } diff --git a/Dalamud/Game/ClientState/Objects/ObjectTable.cs b/Dalamud/Game/ClientState/Objects/ObjectTable.cs index 80db0f200..70c17fd83 100644 --- a/Dalamud/Game/ClientState/Objects/ObjectTable.cs +++ b/Dalamud/Game/ClientState/Objects/ObjectTable.cs @@ -111,8 +111,12 @@ public sealed partial class ObjectTable : IServiceType { ObjectKind.Player => new PlayerCharacter(address), ObjectKind.BattleNpc => new BattleNpc(address), + ObjectKind.EventNpc => new Npc(address), + ObjectKind.Retainer => new Npc(address), ObjectKind.EventObj => new EventObj(address), ObjectKind.Companion => new Npc(address), + ObjectKind.MountType => new Npc(address), + ObjectKind.Ornament => new Npc(address), _ => new GameObject(address), }; } diff --git a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs index 4335f053a..62b69dcec 100644 --- a/Dalamud/Game/ClientState/Objects/Types/GameObject.cs +++ b/Dalamud/Game/ClientState/Objects/Types/GameObject.cs @@ -113,6 +113,11 @@ public unsafe partial class GameObject /// public uint OwnerId => this.Struct->OwnerID; + /// + /// Gets the index of this object in the object table. + /// + public ushort ObjectIndex => this.Struct->ObjectIndex; + /// /// Gets the entity kind of this . /// See the ObjectKind enum for possible values.