Commit 89a2b287 authored by Ivaria's avatar Ivaria
Browse files

Fix HealComm callback handlers

parent 284aea25
...@@ -1588,8 +1588,19 @@ function VUHDO_OnLoad(anInstance) ...@@ -1588,8 +1588,19 @@ function VUHDO_OnLoad(anInstance)
VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_HealStopped", HealComm_HealUpdated); VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_HealStopped", HealComm_HealUpdated);
VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_HealDelayed", HealComm_HealUpdated); VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_HealDelayed", HealComm_HealUpdated);
VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_HealUpdated", HealComm_HealUpdated); VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_HealUpdated", HealComm_HealUpdated);
VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_ModifierChanged", HealComm_HealUpdated);
VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_GUIDDisappeared", HealComm_HealUpdated); local function HealComm_HealModified(aEvent, aTargetGUID)
local tTarget = VUHDO_RAID_GUIDS[aTargetGUID];
if (VUHDO_RAID or tEmptyRaid)[tTarget] then -- auch target, focus
VUHDO_updateHealth(tTarget, 9); -- VUHDO_UPDATE_INC
VUHDO_updateBouquetsForEvent(tTarget, 9); -- VUHDO_UPDATE_ALT_POWER
end
end
anInstance.HealComm_HealModified = HealComm_HealModified;
VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_ModifierChanged", HealComm_HealModified);
VUHDO_LibClassicHealComm.RegisterCallback(anInstance, "HealComm_GUIDDisappeared", HealComm_HealModified);
end end
SLASH_VUHDO1 = "/vuhdo"; SLASH_VUHDO1 = "/vuhdo";
......
...@@ -1104,18 +1104,28 @@ end ...@@ -1104,18 +1104,28 @@ end
function VUHDO_unitGetIncomingHeals(...) function VUHDO_unitGetIncomingHeals(aUnit, aCasterUnit)
if not aUnit then
return 0;
end
if not UnitGetIncomingHeals then if not UnitGetIncomingHeals then
if VUHDO_LibClassicHealComm then if VUHDO_LibClassicHealComm then
local targetGUID = UnitGUID(...); local tTargetGUID = UnitGUID(aUnit);
return (VUHDO_LibClassicHealComm:GetHealAmount(targetGUID, VUHDO_LibClassicHealComm.ALL_HEALS) or 0) * (VUHDO_LibClassicHealComm:GetHealModifier(targetGUID) or 1); if aCasterUnit then
local tCasterGUID = UnitGUID(aCasterUnit);
return (VUHDO_LibClassicHealComm:GetHealAmount(tTargetGUID, VUHDO_LibClassicHealComm.ALL_HEALS, nil, tCasterGUID) or 0) * (VUHDO_LibClassicHealComm:GetHealModifier(tTargetGUID) or 1);
else
return (VUHDO_LibClassicHealComm:GetHealAmount(tTargetGUID, VUHDO_LibClassicHealComm.ALL_HEALS) or 0) * (VUHDO_LibClassicHealComm:GetHealModifier(tTargetGUID) or 1);
end
else else
return 0; return 0;
end end
else else
return UnitGetIncomingHeals(...); return UnitGetIncomingHeals(aUnit, aCasterUnit);
end end
end end
......
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