diff --git a/ECommons b/ECommons index 540b7a353..3f2259f83 160000 --- a/ECommons +++ b/ECommons @@ -1 +1 @@ -Subproject commit 540b7a353814a9d3ed418a2027f5a6f7c4380e9c +Subproject commit 3f2259f8314e54077d509463a32f72506ff6845c diff --git a/XIVSlothCombo/CustomCombo/Functions/Status.cs b/XIVSlothCombo/CustomCombo/Functions/Status.cs index c80a849db..6cd59153a 100644 --- a/XIVSlothCombo/CustomCombo/Functions/Status.cs +++ b/XIVSlothCombo/CustomCombo/Functions/Status.cs @@ -1,7 +1,9 @@ using Dalamud.Game.ClientState.Objects.Types; using Dalamud.Game.ClientState.Statuses; +using FFXIVClientStructs.FFXIV.Client.Game; using XIVSlothCombo.Data; using XIVSlothCombo.Services; +using Status = Dalamud.Game.ClientState.Statuses.Status; namespace XIVSlothCombo.CustomComboNS.Functions { @@ -18,10 +20,12 @@ public static byte GetBuffStacks(ushort effectId) return eff?.StackCount ?? 0; } - public static float GetBuffRemainingTime(ushort effectId) + public unsafe static float GetBuffRemainingTime(ushort effectId) { Status? eff = FindEffect(effectId); - return eff?.RemainingTime ?? 0; + if (eff is null) return 0; + if (eff.RemainingTime < 0) return (eff.RemainingTime * -1) + ActionManager.Instance()->AnimationLock; + return eff.RemainingTime; } /// Finds an effect on the player. The effect must be owned by the player or unowned. @@ -40,10 +44,12 @@ public static float GetBuffRemainingTime(ushort effectId) public static Status? FindTargetEffect(ushort effectID) => FindEffect(effectID, CurrentTarget, LocalPlayer?.GameObjectId); /// - public static float GetDebuffRemainingTime(ushort effectId) + public unsafe static float GetDebuffRemainingTime(ushort effectId) { Status? eff = FindTargetEffect(effectId); - return eff?.RemainingTime ?? 0; + if (eff is null) return 0; + if (eff.RemainingTime < 0) return (eff.RemainingTime * -1) + ActionManager.Instance()->AnimationLock; + return eff.RemainingTime; } /// Find if an effect on the player exists. The effect may be owned by anyone or unowned.