mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
fix player buff stacks count and all unit stack count off by one
This commit is contained in:
+8
-2
@@ -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
|
||||
|
||||
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user