From 4ccd0f81aa984942befc5a5410905b97e68d8be3 Mon Sep 17 00:00:00 2001 From: Jrc13245 Date: Fri, 6 Mar 2026 16:44:36 -0500 Subject: [PATCH] fix player buff stacks count and all unit stack count off by one --- Conditionals.lua | 10 ++++++++-- NampowerAPI.lua | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Conditionals.lua b/Conditionals.lua index cf93715..58f9266 100644 --- a/Conditionals.lua +++ b/Conditionals.lua @@ -3450,8 +3450,10 @@ function CleveRoids.ValidateAura(unit, args, isbuff) -- For buff checks: only accept buff slots (1-32) if gufSlot <= 32 then found = true - stacks = gufStacks or 0 if isPlayer then + -- GetUnitField auraApplications may not work for player token + -- without SuperWoW; use standard API for reliable stacks + stacks = GetPlayerBuffApplications(gufSlot - 1) or gufStacks or 0 -- GetPlayerAuraDuration (Nampower) is primary: GetPlayerBuffTimeLeft -- returns 0 for auras found via GetUnitField fast path if _G.GetPlayerAuraDuration then @@ -3467,13 +3469,15 @@ function CleveRoids.ValidateAura(unit, args, isbuff) if remaining == nil then remaining = GetPlayerBuffTimeLeft(gufSlot - 1) end + else + stacks = gufStacks or 0 end end else -- For debuff checks: accept any slot (debuffs overflow to buff slots) found = true - stacks = gufStacks or 0 if isPlayer then + stacks = GetPlayerBuffApplications(gufSlot - 1) or gufStacks or 0 -- GetPlayerAuraDuration (Nampower) is primary: GetPlayerBuffTimeLeft -- returns 0 for auras found via GetUnitField fast path if _G.GetPlayerAuraDuration then @@ -3489,6 +3493,8 @@ function CleveRoids.ValidateAura(unit, args, isbuff) if remaining == nil then remaining = GetPlayerBuffTimeLeft(gufSlot - 1) end + else + stacks = gufStacks or 0 end end end diff --git a/NampowerAPI.lua b/NampowerAPI.lua index 7740834..6c5ee6b 100644 --- a/NampowerAPI.lua +++ b/NampowerAPI.lua @@ -1358,7 +1358,8 @@ function API.FindUnitAuraInfo(unitToken, searchSpellId, searchNameLower) end if matched then - local stacks = applications and applications[i] or 0 + -- auraApplications is 0-indexed (0 = 1 stack); convert to 1-indexed + local stacks = applications and (applications[i] or 0) + 1 or 0 return true, auraId, stacks, i end end