diff --git a/Dalamud/Game/ClientState/Actors/ActorTable.cs b/Dalamud/Game/ClientState/Actors/ActorTable.cs index e11374fb9..1af976b1c 100644 --- a/Dalamud/Game/ClientState/Actors/ActorTable.cs +++ b/Dalamud/Game/ClientState/Actors/ActorTable.cs @@ -109,9 +109,9 @@ namespace Dalamud.Game.ClientState.Actors { switch (actorStruct.ObjectKind) { - case ObjectKind.Player: return new PlayerCharacter(actorStruct, this.dalamud); - case ObjectKind.BattleNpc: return new BattleNpc(actorStruct, this.dalamud); - default: return new Actor(actorStruct, this.dalamud); + case ObjectKind.Player: return new PlayerCharacter(offset, actorStruct, this.dalamud); + case ObjectKind.BattleNpc: return new BattleNpc(offset, actorStruct, this.dalamud); + default: return new Actor(offset, actorStruct, this.dalamud); } } } diff --git a/Dalamud/Game/ClientState/Actors/Types/Actor.cs b/Dalamud/Game/ClientState/Actors/Types/Actor.cs index fd9a06584..275a5cd39 100644 --- a/Dalamud/Game/ClientState/Actors/Types/Actor.cs +++ b/Dalamud/Game/ClientState/Actors/Types/Actor.cs @@ -1,3 +1,5 @@ +using System; + namespace Dalamud.Game.ClientState.Actors.Types { /// /// This class represents a basic FFXIV actor. @@ -10,14 +12,21 @@ namespace Dalamud.Game.ClientState.Actors.Types { protected Dalamud dalamud; + /// + /// The address of this actor in memory. + /// + public readonly IntPtr Address; + /// /// Initialize a representation of a basic FFXIV actor. /// /// The memory representation of the base actor. /// A dalamud reference needed to access game data in Resolvers. - public Actor(Structs.Actor actorStruct, Dalamud dalamud) { + /// The address of this actor in memory. + public Actor(IntPtr address, Structs.Actor actorStruct, Dalamud dalamud) { this.actorStruct = actorStruct; this.dalamud = dalamud; + this.Address = address; } /// diff --git a/Dalamud/Game/ClientState/Actors/Types/Chara.cs b/Dalamud/Game/ClientState/Actors/Types/Chara.cs index 4c01753db..45471e719 100644 --- a/Dalamud/Game/ClientState/Actors/Types/Chara.cs +++ b/Dalamud/Game/ClientState/Actors/Types/Chara.cs @@ -1,3 +1,4 @@ +using System; using Dalamud.Game.ClientState.Actors.Resolvers; namespace Dalamud.Game.ClientState.Actors.Types { @@ -10,7 +11,8 @@ namespace Dalamud.Game.ClientState.Actors.Types { /// /// The memory representation of the base actor. /// A dalamud reference needed to access game data in Resolvers. - protected Chara(Structs.Actor actorStruct, Dalamud dalamud) : base(actorStruct, dalamud) { } + /// The address of this actor in memory. + protected Chara(IntPtr address, Structs.Actor actorStruct, Dalamud dalamud) : base(address, actorStruct, dalamud) { } /// /// The level of this Chara. diff --git a/Dalamud/Game/ClientState/Actors/Types/NonPlayer/BattleNpc.cs b/Dalamud/Game/ClientState/Actors/Types/NonPlayer/BattleNpc.cs index d316cb730..b4be1321e 100644 --- a/Dalamud/Game/ClientState/Actors/Types/NonPlayer/BattleNpc.cs +++ b/Dalamud/Game/ClientState/Actors/Types/NonPlayer/BattleNpc.cs @@ -1,3 +1,5 @@ +using System; + namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer { /// /// This class represents a battle NPC. @@ -8,7 +10,8 @@ namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer { /// /// The memory representation of the base actor. /// A dalamud reference needed to access game data in Resolvers. - public BattleNpc(Structs.Actor actorStruct, Dalamud dalamud) : base(actorStruct, dalamud) { } + /// The address of this actor in memory. + public BattleNpc(IntPtr address, Structs.Actor actorStruct, Dalamud dalamud) : base(address, actorStruct, dalamud) { } /// /// The BattleNpc of this BattleNpc. diff --git a/Dalamud/Game/ClientState/Actors/Types/NonPlayer/Npc.cs b/Dalamud/Game/ClientState/Actors/Types/NonPlayer/Npc.cs index 6f8681aab..99cb9e739 100644 --- a/Dalamud/Game/ClientState/Actors/Types/NonPlayer/Npc.cs +++ b/Dalamud/Game/ClientState/Actors/Types/NonPlayer/Npc.cs @@ -1,3 +1,5 @@ +using System; + namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer { /// /// This class represents a NPC. @@ -8,7 +10,8 @@ namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer { /// /// The memory representation of the base actor. /// A dalamud reference needed to access game data in Resolvers. - protected Npc(Structs.Actor actorStruct, Dalamud dalamud) : base(actorStruct, dalamud) { } + /// The address of this actor in memory. + protected Npc(IntPtr address, Structs.Actor actorStruct, Dalamud dalamud) : base(address, actorStruct, dalamud) { } /// /// The data ID of the NPC linking to their respective game data. diff --git a/Dalamud/Game/ClientState/Actors/Types/PlayerCharacter.cs b/Dalamud/Game/ClientState/Actors/Types/PlayerCharacter.cs index 818c828a7..366794513 100644 --- a/Dalamud/Game/ClientState/Actors/Types/PlayerCharacter.cs +++ b/Dalamud/Game/ClientState/Actors/Types/PlayerCharacter.cs @@ -1,3 +1,4 @@ +using System; using Dalamud.Game.ClientState.Actors.Resolvers; using SharpDX.Text; @@ -11,7 +12,8 @@ namespace Dalamud.Game.ClientState.Actors.Types { /// /// The memory representation of the base actor. /// A dalamud reference needed to access game data in Resolvers. - public PlayerCharacter(Structs.Actor actorStruct, Dalamud dalamud) : base(actorStruct, dalamud) { } + /// The address of this actor in memory. + public PlayerCharacter(IntPtr address, Structs.Actor actorStruct, Dalamud dalamud) : base(address, actorStruct, dalamud) { } /// /// The current world of the character. diff --git a/Dalamud/Interface/DalamudDataWindow.cs b/Dalamud/Interface/DalamudDataWindow.cs index 148e409c5..12deccc3d 100644 --- a/Dalamud/Interface/DalamudDataWindow.cs +++ b/Dalamud/Interface/DalamudDataWindow.cs @@ -81,13 +81,13 @@ namespace Dalamud.Interface stateString += $"HomeWorldName: {this.dalamud.ClientState.LocalPlayer.HomeWorld.GameData.Name}\n"; stateString += $"LocalCID: {this.dalamud.ClientState.LocalContentId:X}\n"; stateString += $"LastLinkedItem: {this.dalamud.Framework.Gui.Chat.LastLinkedItemId.ToString()}\n"; - stateString += $"TerritoryType: {this.dalamud.ClientState.TerritoryType}\n"; + stateString += $"TerritoryType: {this.dalamud.ClientState.TerritoryType}\n\n"; for (var i = 0; i < this.dalamud.ClientState.Actors.Length; i++) { var actor = this.dalamud.ClientState.Actors[i]; stateString += - $" -> {actor.ActorId:X}[{i}] - {actor.ObjectKind} - {actor.Name} - {actor.Position.X} {actor.Position.Y} {actor.Position.Z}\n"; + $"{actor.Address.ToInt64():X}:{actor.ActorId:X}[{i}] - {actor.ObjectKind} - {actor.Name} - {actor.Position.X} {actor.Position.Y} {actor.Position.Z}\n"; if (actor is Npc npc) stateString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n";