diff --git a/Dalamud/Game/ClientState/Objects/ObjectTable.cs b/Dalamud/Game/ClientState/Objects/ObjectTable.cs index c6320ccbb..278c0772f 100644 --- a/Dalamud/Game/ClientState/Objects/ObjectTable.cs +++ b/Dalamud/Game/ClientState/Objects/ObjectTable.cs @@ -23,7 +23,7 @@ namespace Dalamud.Game.ClientState.Objects; #pragma warning restore SA1015 internal sealed partial class ObjectTable : IServiceType, IObjectTable { - private const int ObjectTableLength = 596; + private const int ObjectTableLength = 599; private readonly ClientStateAddressResolver address; diff --git a/Dalamud/Game/ClientState/Statuses/StatusList.cs b/Dalamud/Game/ClientState/Statuses/StatusList.cs index bcff50360..fce59e29b 100644 --- a/Dalamud/Game/ClientState/Statuses/StatusList.cs +++ b/Dalamud/Game/ClientState/Statuses/StatusList.cs @@ -10,8 +10,6 @@ namespace Dalamud.Game.ClientState.Statuses; /// public sealed unsafe partial class StatusList { - private const int StatusListLength = 30; - /// /// Initializes a new instance of the class. /// @@ -38,7 +36,7 @@ public sealed unsafe partial class StatusList /// /// Gets the amount of status effect slots the actor has. /// - public int Length => StatusListLength; + public int Length => Struct->NumValidStatuses; private static int StatusSize { get; } = Marshal.SizeOf(); @@ -53,7 +51,7 @@ public sealed unsafe partial class StatusList { get { - if (index < 0 || index > StatusListLength) + if (index < 0 || index > this.Length) return null; var addr = this.GetStatusAddress(index); @@ -107,7 +105,7 @@ public sealed unsafe partial class StatusList /// The memory address of the party member. public IntPtr GetStatusAddress(int index) { - if (index < 0 || index >= StatusListLength) + if (index < 0 || index >= this.Length) return IntPtr.Zero; return (IntPtr)(this.Struct->Status + (index * StatusSize)); @@ -134,7 +132,7 @@ public sealed partial class StatusList : IReadOnlyCollection, ICollectio /// public IEnumerator GetEnumerator() { - for (var i = 0; i < StatusListLength; i++) + for (var i = 0; i < this.Length; i++) { var status = this[i];