Commit 669de040 authored by Ivaria's avatar Ivaria
Browse files

Fixed unnecessary shield value updates for irrelevant spells. Fixed shield...

Fixed unnecessary shield value updates for irrelevant spells. Fixed shield overwrite detection when new shield amount is smaller.
parent 0d708c34
......@@ -193,15 +193,21 @@ end
--
local tIconInfo;
local tFound;
function VUHDO_updateDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration, anIsBuff, aSpellId, aCnt)
if not VUHDO_DEBUFF_ICONS[aUnit] then
VUHDO_DEBUFF_ICONS[aUnit] = { };
end
tFound = false;
for tCnt = 1, sMaxIcons do
tIconInfo = VUHDO_DEBUFF_ICONS[aUnit][tCnt];
if tIconInfo and tIconInfo[3] == aName then
tFound = true;
tIconInfo[1], tIconInfo[3], tIconInfo[4], tIconInfo[5], tIconInfo[6], tIconInfo[7] = anIcon, aName, anExpiry, aStacks, aDuration, aSpellId;
for _, tButton in pairs(VUHDO_getUnitButtonsSafe(aUnit)) do
......@@ -210,6 +216,11 @@ function VUHDO_updateDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDurati
end
end
end
if not tFound then
VUHDO_addDebuffIcon(aUnit, anIcon, aName, anExpiry, aStacks, aDuration, anIsBuff, aSpellId, aCnt);
end
end
......
......@@ -373,7 +373,7 @@ function VUHDO_determineDebuff(aUnit)
if not VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName] then
-- tExpiry, tStacks, tIcon
VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName] = { tDebuffInfo[2], tDebuffInfo[3], tDebuffInfo[1] };
VUHDO_UNIT_CUSTOM_DEBUFFS[aUnit][tName] = { tDebuffInfo[2], tDebuffInfo[3], tDebuffInfo[1], tDebuffInfo[7] };
VUHDO_addDebuffIcon(aUnit, tDebuffInfo[1], tName, tDebuffInfo[2], tDebuffInfo[3], tDebuffInfo[4], tDebuffInfo[5], tDebuffInfo[6], tDebuffInfo[7]);
......@@ -556,3 +556,11 @@ function VUHDO_resetDebuffsFor(aUnit)
end
--
function VUHDO_getUnitCustomDebuffs()
return VUHDO_UNIT_CUSTOM_DEBUFFS;
end
......@@ -155,12 +155,11 @@ local function VUHDO_updateShieldValue(aUnit, aShieldName, anAmount, aDuration)
return;
end
if aDuration and VUHDO_SHIELD_LEFT[aUnit][aShieldName] <= anAmount then
if aDuration then
VUHDO_SHIELD_EXPIRY[aUnit][aShieldName] = GetTime() + aDuration;
VUHDO_SHIELD_SIZE[aUnit][aShieldName] = anAmount;
--VUHDO_xMsg("Shield overwritten");
end
if VUHDO_SHIELD_SIZE[aUnit][aShieldName] < anAmount then
elseif VUHDO_SHIELD_SIZE[aUnit][aShieldName] < anAmount then
VUHDO_SHIELD_SIZE[aUnit][aShieldName] = anAmount;
end
......@@ -311,7 +310,7 @@ function VUHDO_parseCombatLogShieldAbsorb(aMessage, aSrcGuid, aDstGuid, aShieldN
VUHDO_removeShield(tUnit, aShieldName);
VUHDO_DEBUFF_SHIELDS[tUnit] = nil;
end
elseif "SPELL_HEAL" == aMessage or "SPELL_PERIODIC_HEAL" == aMessage
elseif ("SPELL_HEAL" == aMessage or "SPELL_PERIODIC_HEAL" == aMessage)
and VUHDO_DEBUFF_SHIELDS[tUnit]
and (tonumber(anAbsorbAmount) or 0) > 0 then
tShieldName = VUHDO_DEBUFF_SHIELDS[tUnit];
......
......@@ -12,6 +12,8 @@ Known issues:
Bugfixes:
-- Fixed hostile spells options UI recognition of talents and items
-- Fixed custom debuff spell source filter when aura is a buff
-- Fixed unnecessary shield value updates for irrelevant spells
-- Fixed shield overwrite detection when new shield amount is smaller
Improvements:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment