Commit 90bfdbb1 authored by Ivaria's avatar Ivaria
Browse files

Merge branch 'fix_health_suddenlty_incorrect' into 'tbcc'

Fix #416 Health suddenly incorrectly displayed

See merge request vuhdo/vuhdo!48
parents cd797b35 18884b33
......@@ -57,10 +57,17 @@ end
--
local tPre, tSuf, tSpec;
local function VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4)
local function VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4, aSourceFlags)
tPre, tSuf, tSpec = strsplit("_", aMsg);
if "SPELL" == tPre then
-- Filter subEvent SPELL_DURABILITY_DAMAGE
-- and sourceflag COMBATLOG_OBJECT_TYPE_PLAYER COMBATLOG_OBJECT_REACTION_FRIENDLY 0x00000510
-- Avoid some items such as Force Reactive Disk break the parser
if tSuf == "DURABILITY" and tSpec == "DAMAGE" and bit.band(aSourceFlags,1296) == 1296 then
return 0;
end
if ("HEAL" == tSuf or "HEAL" == tSpec) and "MISSED" ~= tSpec then
return aMsg4;
elseif "DAMAGE" == tSuf or "DAMAGE" == tSpec then
......@@ -112,12 +119,12 @@ end
--
local tUnit;
local tImpact;
function VUHDO_parseCombatLogEvent(aMsg, aDstGUID, aMsg1, aMsg2, aMsg4)
function VUHDO_parseCombatLogEvent(aMsg, aDstGUID, aMsg1, aMsg2, aMsg4, aSourceFlags)
tUnit = VUHDO_RAID_GUIDS[aDstGUID];
if not tUnit then return; end
-- as of patch 7.1 we are seeing empty values on health related events
tImpact = tonumber(VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4)) or 0;
tImpact = tonumber(VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4, aSourceFlags)) or 0;
if tImpact ~= 0 then
VUHDO_addUnitHealth(tUnit, tImpact);
......
......@@ -425,7 +425,7 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
-- SWING_DAMAGE - the amount of damage is the 12th arg
-- ENVIRONMENTAL_DAMAGE - the amount of damage is the 13th arg
-- for all other events with the _DAMAGE suffix the amount of damage is the 15th arg
VUHDO_parseCombatLogEvent(anArg2, anArg8, anArg12, anArg13, anArg15);
VUHDO_parseCombatLogEvent(anArg2, anArg8, anArg12, anArg13, anArg15, anArg6);
if VUHDO_INTERNAL_TOGGLES[36] then -- VUHDO_UPDATE_SHIELD
-- for SPELL events with _AURA suffixes the amount healed is the 16th arg
......
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