Merge pull request #42 from jrc13245/claude/debug-debuff-overflow-01NhVniaTU74TFM4ZCJUtzkn

fix debuff overflow
This commit is contained in:
Torio
2025-11-16 18:23:07 -05:00
committed by GitHub
2 changed files with 17 additions and 10 deletions
+1 -1
View File
@@ -649,7 +649,7 @@ function CleveRoids.ValidateAura(unit, args, isbuff)
-- UnitBuff => texture, stacks, spellID
texture, stacks, current_spellID = UnitBuff(unit, i)
else
-- UnitDebuff => texture, stacks, _, spellID
-- UnitDebuff => texture, stacks, debuffType, spellID
texture, stacks, _, current_spellID = UnitDebuff(unit, i)
end
remaining = nil
+16 -9
View File
@@ -755,8 +755,9 @@ function lib:UnitDebuff(unit, id)
local texture, stacks, dtype, spellID = UnitDebuff(unit, id)
if not texture or not spellID then
texture, stacks, _, spellID = UnitBuff(unit, id)
if texture and spellID and not lib.durations[spellID] then
texture, stacks, spellID = UnitBuff(unit, id)
-- Only accept buffs that are known debuffs (either static or learned durations)
if texture and spellID and lib:GetDuration(spellID) <= 0 then
return nil
end
end
@@ -792,20 +793,26 @@ local function SeedUnit(unit)
local tex, stacks, dtype, spellID = UnitDebuff(unit, i)
if not tex then break end
if spellID and lib.durations[spellID] then
if not (lib.objects[guid] and lib.objects[guid][spellID]) then
lib:AddEffect(guid, unitName, spellID, lib:GetDuration(spellID), stacks)
if spellID then
local duration = lib:GetDuration(spellID)
if duration > 0 then
if not (lib.objects[guid] and lib.objects[guid][spellID]) then
lib:AddEffect(guid, unitName, spellID, duration, stacks)
end
end
end
end
for i=1, 32 do
local tex, stacks, _, spellID = UnitBuff(unit, i)
local tex, stacks, spellID = UnitBuff(unit, i)
if not tex then break end
if spellID and lib.durations[spellID] then
if not (lib.objects[guid] and lib.objects[guid][spellID]) then
lib:AddEffect(guid, unitName, spellID, lib:GetDuration(spellID), stacks)
if spellID then
local duration = lib:GetDuration(spellID)
if duration > 0 then
if not (lib.objects[guid] and lib.objects[guid][spellID]) then
lib:AddEffect(guid, unitName, spellID, duration, stacks)
end
end
end
end