Commit 0c50833e authored by Ivaria's avatar Ivaria
Browse files

Fixed handling of empty values in health related combat log events. Disabled...

Fixed handling of empty values in health related combat log events. Disabled retrieval of unit facing and map position inside instances.
parent fcff5d02
......@@ -34,12 +34,12 @@ local VUHDO_PANEL_UNITS = { };
setmetatable(VUHDO_PANEL_UNITS, VUHDO_META_NEW_ARRAY);
-- TODO: make local
VUHDO_BOSS_UNIT = { };
VUHDO_BOSS_UNITS = { };
for i = 1, MAX_BOSS_FRAMES do
local bossUnitId = format("boss%d", i);
VUHDO_BOSS_UNIT[bossUnitId] = true;
VUHDO_BOSS_UNITS[bossUnitId] = true;
end
VUHDO_PLAYER_CLASS = nil;
......@@ -425,6 +425,11 @@ end
local tOwner;
local tIsPet;
function VUHDO_updateHealth(aUnit, aMode)
-- as of patch 7.1 we are seeing empty units on health related events
if not aUnit then
return;
end
tIsPet = VUHDO_RAID[aUnit] and VUHDO_RAID[aUnit]["isPet"];
if not tIsPet or VUHDO_INTERNAL_TOGGLES[26] then -- VUHDO_UPDATE_PETS -- Enthlt nur Pets als eigene Balken, vehicles werden ?ber owner dargestellt s.unten
......@@ -571,7 +576,7 @@ end
--
local function VUHDO_addUnitToBosses()
for bossUnitId, _ in pairs(VUHDO_BOSS_UNIT) do
for bossUnitId, _ in pairs(VUHDO_BOSS_UNITS) do
VUHDO_tableUniqueAdd(VUHDO_GROUPS[44], bossUnitId); -- VUHDO_ID_BOSSES
end
end
......@@ -784,7 +789,7 @@ function VUHDO_reloadRaidMembers()
VUHDO_setHealthSafe("target", 1); -- VUHDO_UPDATE_ALL
end
for bossUnitId, _ in pairs(VUHDO_BOSS_UNIT) do
for bossUnitId, _ in pairs(VUHDO_BOSS_UNITS) do
if UnitExists(bossUnitId) then
VUHDO_setHealth(bossUnitId, 1); -- VUHDO_UPDATE_ALL
else
......@@ -876,7 +881,7 @@ function VUHDO_refreshRaidMembers()
VUHDO_setHealthSafe("target", 1); -- VUHDO_UPDATE_ALL
end
for bossUnitId, _ in pairs(VUHDO_BOSS_UNIT) do
for bossUnitId, _ in pairs(VUHDO_BOSS_UNITS) do
if UnitExists(bossUnitId) then -- and UnitIsFriend("player", bossUnitId) then
tInfo = VUHDO_RAID[bossUnitId];
......
## Interface: 70000
## Interface: 70100
## Title: VuhDo ['vu:du:]
## Author: Iza@Gilneas, humfras, Ivaria@Hyjal
## Version: 3.77
## Version: 3.78
## Notes: Raid Frames providing click-heal functionality, buff and debuff control, main tank management and much more
## SavedVariablesPerCharacter: VUHDO_CONFIG, VUHDO_PANEL_SETUP, VUHDO_SPELL_ASSIGNMENTS, VUHDO_HOSTILE_SPELL_ASSIGNMENTS, VUHDO_MM_SETTINGS, VUHDO_PLAYER_TARGETS, VUHDO_MAINTANK_NAMES, VUHDO_BUFF_SETTINGS, VUHDO_POWER_TYPE_COLORS, VUHDO_SPELLS_KEYBOARD, VUHDO_SPELL_CONFIG, VUHDO_BUFF_ORDER, VUHDO_SPEC_LAYOUTS, VUHDO_GROUP_SIZE, VUHDO_RAID, VUHDO_INDICATOR_CONFIG
## SavedVariables: VUHDO_DEFAULT_LAYOUT, VUHDO_DEFAULT_PROFILE, VUHDO_PROFILES, VUHDO_MANUAL_ROLES, VUHDO_SPELL_LAYOUTS, VUHDO_USER_CLASS_COLORS, VUHDO_DEBUFF_BLACKLIST, VUHDO_BOUQUETS, VUHDO_COMBAT_LOG_TRACE, VUHDO_GLOBAL_CONFIG, VUHDO_DEBUG
......
......@@ -668,9 +668,14 @@ end
local tInfo;
local tAllButtons;
function VUHDO_updateHealthBarsFor(aUnit, anUpdateMode)
-- as of patch 7.1 we are seeing empty units on health related events
if not aUnit then
return;
end
VUHDO_updateBouquetsForEvent(aUnit, anUpdateMode);
tAllButtons = VUHDO_getUnitButtons(aUnit);
tAllButtons = VUHDO_getUnitButtons(aUnit);
if not tAllButtons then return; end
if 2 == anUpdateMode then -- VUHDO_UPDATE_HEALTH
......
......@@ -140,17 +140,27 @@ end
--
local tX1, tY1, tX2, tY2;
local tIsValid;
local tIsInInstance;
local function VUHDO_determineDistanceBetween(aUnit, anotherUnit)
-- as of patch 7.1 APIs related to unit position/distance do not function inside instances
tIsInInstance, _ = IsInInstance();
if tIsInInstance then
return nil, nil;
end
tIsValid = true;
-- as of patch 7.1 GetPlayerMapPosition() returns zero/nil inside certain zones
tX1, tY1 = GetPlayerMapPosition(aUnit);
if tX1 + tY1 <= 0 then
if not tX1 or (tX1 + tY1 <= 0) then
VUHDO_CLUSTER_BLACKLIST[aUnit] = true;
tIsValid = false;
end
-- as of patch 7.1 GetPlayerMapPosition() returns zero/nil inside certain zones
tX2, tY2 = GetPlayerMapPosition(anotherUnit);
if tX2 + tY2 <= 0 then
if not tX2 or (tX2 + tY2 <= 0) then
VUHDO_CLUSTER_BLACKLIST[anotherUnit] = true;
tIsValid = false;
end
......
......@@ -49,13 +49,22 @@ local function VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4)
tPre, tSuf, tSpec = strsplit("_", aMsg);
if "SPELL" == tPre then
if ("HEAL" == tSuf or "HEAL" == tSpec) and "MISSED" ~= tSpec then return aMsg4;
elseif "DAMAGE" == tSuf or "DAMAGE" == tSpec then return -aMsg4; end
if ("HEAL" == tSuf or "HEAL" == tSpec) and "MISSED" ~= tSpec then
return aMsg4;
elseif "DAMAGE" == tSuf or "DAMAGE" == tSpec then
return -aMsg4;
end
elseif "DAMAGE" == tSuf then
if "SWING" == tPre then return -aMsg1;
elseif "RANGE" == tPre then return -aMsg4;
elseif "ENVIRONMENTAL" == tPre then return -aMsg2 end
elseif "DAMAGE" == tPre and "MISSED" ~= tSpec and "RESISTED" ~= tSpec then return -aMsg4; end
if "SWING" == tPre then
return -aMsg1;
elseif "RANGE" == tPre then
return -aMsg4;
elseif "ENVIRONMENTAL" == tPre then
return -aMsg2;
end
elseif "DAMAGE" == tPre and "MISSED" ~= tSpec and "RESISTED" ~= tSpec then
return -aMsg4;
end
return 0;
end
......@@ -95,7 +104,9 @@ function VUHDO_parseCombatLogEvent(aMsg, aDstGUID, aMsg1, aMsg2, aMsg4)
tUnit = VUHDO_RAID_GUIDS[aDstGUID];
if not tUnit then return; end
tImpact = VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4);
-- as of patch 7.1 we are seeing empty values on health related events
tImpact = tonumber(VUHDO_getTargetHealthImpact(aMsg, aMsg1, aMsg2, aMsg4)) or 0;
if tImpact ~= 0 then
VUHDO_addUnitHealth(tUnit, tImpact);
if tUnit == sCurrentTarget then VUHDO_addUnitHealth("target", tImpact); end
......
......@@ -60,7 +60,7 @@ local _;
local tostring = tostring;
local sIsNotRemovableOnly;
local sIsNotRemoveableOnlyIcons;
local sIsNotRemovableOnlyIcons;
local sIsUseDebuffIcon;
local sIsUseDebuffIconBossOnly;
local sIsMiBuColorsInFight;
......@@ -78,7 +78,7 @@ function VUHDO_debuffsInitLocalOverrides()
VUHDO_shouldScanUnit = _G["VUHDO_shouldScanUnit"];
sIsNotRemovableOnly = not VUHDO_CONFIG["DETECT_DEBUFFS_REMOVABLE_ONLY"];
sIsNotRemoveableOnlyIcons = not VUHDO_CONFIG["DETECT_DEBUFFS_REMOVABLE_ONLY_ICONS"];
sIsNotRemovableOnlyIcons = not VUHDO_CONFIG["DETECT_DEBUFFS_REMOVABLE_ONLY_ICONS"];
sIsUseDebuffIcon = VUHDO_PANEL_SETUP["BAR_COLORS"]["useDebuffIcon"];
sIsUseDebuffIconBossOnly = VUHDO_PANEL_SETUP["BAR_COLORS"]["useDebuffIconBossOnly"];
sIsMiBuColorsInFight = VUHDO_BUFF_SETTINGS["CONFIG"]["BAR_COLORS_IN_FIGHT"];
......@@ -334,7 +334,7 @@ function VUHDO_determineDebuff(aUnit)
and tIsRelevant then
if sIsUseDebuffIcon and (tIsBossDebuff or not sIsUseDebuffIconBossOnly)
and (sIsNotRemoveableOnlyIcons or tAbility ~= nil) then
and (sIsNotRemovableOnlyIcons or tAbility ~= nil) then
sCurIcons[tName] = VUHDO_getOrCreateIconArray(tIcon, tExpiry, tStacks, tDuration, false, tSpellId);
sCurIsStandard = true;
......
......@@ -427,12 +427,16 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
end
elseif "UNIT_HEALTH" == anEvent then
if (VUHDO_RAID or tEmptyRaid)[anArg1] then VUHDO_updateHealth(anArg1, 2); end -- VUHDO_UPDATE_HEALTH
-- as of patch 7.1 we are seeing empty units on health related events
if anArg1 and (VUHDO_RAID or tEmptyRaid)[anArg1] then
VUHDO_updateHealth(anArg1, 2); -- VUHDO_UPDATE_HEALTH
end
-- TODO: is it ok to listen to both UNIT_HEALTH and UNIT_HEALTH_FREQUENT?
-- TODO: add options based on desired responsiveness and performance
elseif "UNIT_HEALTH_FREQUENT" == anEvent then
if (VUHDO_RAID or tEmptyRaid)[anArg1] or VUHDO_isBossUnit(anArg1) then
-- as of patch 7.1 we are seeing empty units on health related events
if anArg1 and ((VUHDO_RAID or tEmptyRaid)[anArg1] or VUHDO_isBossUnit(anArg1)) then
VUHDO_updateHealth(anArg1, 2);
end
......@@ -483,7 +487,10 @@ function VUHDO_OnEvent(_, anEvent, anArg1, anArg2, anArg3, anArg4, anArg5, anArg
VUHDO_setIsOutOfCombat(false);
elseif "UNIT_MAXHEALTH" == anEvent then
if (VUHDO_RAID or tEmptyRaid)[anArg1] then VUHDO_updateHealth(anArg1, VUHDO_UPDATE_HEALTH_MAX); end
-- as of patch 7.1 we are seeing empty units on health related events
if anArg1 and (VUHDO_RAID or tEmptyRaid)[anArg1] then
VUHDO_updateHealth(anArg1, VUHDO_UPDATE_HEALTH_MAX);
end
elseif "UNIT_TARGET" == anEvent then
if VUHDO_VARIABLES_LOADED and "player" ~= anArg1 then
......
## Interface: 70000
## Interface: 70100
## Title: VuhDo ['vu:du:] - Options
## Author: Iza@Gilneas, humfras, Ivaria@Hyjal
## Version: 3.77
## Version: 3.78
## Notes: VuhDo Options
## SavedVariables: VUHDO_OPTIONS_SETTINGS
## SavedVariablesPerCharacter: VUHDO_GLOBAL_ICONS, VUHDO_GI_SCAN_IDX
......
......@@ -774,8 +774,12 @@ end
local tPlayerX, tPlayerY;
local tUnitX, tUnitY;
local tFacing;
local tIsInInstance;
function VUHDO_getUnitDirection(aUnit)
if (WorldMapFrame ~= nil and WorldMapFrame:IsShown())
-- as of patch 7.1 GetPlayerFacing()/GetPlayerMapPosition() do not function inside instances
tIsInInstance, _ = IsInInstance();
if tIsInInstance or (WorldMapFrame ~= nil and WorldMapFrame:IsShown())
or (GetMouseFocus() ~= nil and GetMouseFocus():GetName() == nil) then
return nil;
end
......
Version 3.78
Known issues:
-- Limited support for Class Order Hall Bodyguards
-- Bodyguards can be used in panels when set to target or focus
-- Bodyguards have no unit ID so for now are only partially supported
-- Incoming heal estimation reported is not even close to accurate
-- Bug in Blizzard API UnitGetIncomingHeals() - returns bogus values
-- Patch 7.1 disabled retrieval of unit facing and position in instances
-- This was an intentional breaking change by Blizzard
-- This breaks AOE Advice, Clusters and out-of-range direction arrow
-- At this time there is no way to fix or renable these features
Bugfixes:
-- Fixed handling of empty values in health related combat log events
-- Disabled retrieval of unit facing and map position inside instances
--------------------------------------------------------------
Version 3.77
......
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