Skip to content

Commit

Permalink
Clean up hidden aura scanning code and add a "UNIT_NOT_VISIBLE" arg t…
Browse files Browse the repository at this point in the history
…o make potential false positives a bit more obvious.
  • Loading branch information
funkydude committed Jul 20, 2018
1 parent 17b408c commit 913fd8c
Showing 1 changed file with 10 additions and 26 deletions.
36 changes: 10 additions & 26 deletions Transcriptor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1044,42 +1044,26 @@ do
for j = 1, #units do
local unit = units[j]
for i = 1, 100 do
local _, _, _, _, _, _, _, _, _, spellId = UnitAura(unit, i, "HARMFUL")
if spellId then
if not hiddenAuraInitList[spellId] then
hiddenAuraInitList[spellId] = true
end
else
break
end
end
for i = 1, 100 do
local _, _, _, _, _, _, _, _, _, spellId = UnitAura(unit, i, "HELPFUL")
if spellId then
if not hiddenAuraInitList[spellId] then
hiddenAuraInitList[spellId] = true
end
else
local _, _, _, _, _, _, _, _, _, spellId = UnitAura(unit, i, "HARMFUL|HELPFUL")
if not spellId then
break
elseif not hiddenAuraInitList[spellId] then
hiddenAuraInitList[spellId] = true
end
end
end
end
function sh.UNIT_AURA(unit)
for i = 1, 100 do
local name, _, _, _, duration, _, _, _, _, spellId = UnitAura(unit, i, "HARMFUL")
local name, _, _, _, duration, _, _, _, _, spellId = UnitAura(unit, i, "HARMFUL|HELPFUL")
if not spellId then
break
elseif not hiddenUnitAuraCollector[spellId] then
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall("DEBUFF", spellId, name, duration, unit, UnitName(unit)))
end
end
for i = 1, 100 do
local name, _, _, _, duration, _, _, _, _, spellId = UnitAura(unit, i, "HELPFUL")
if not spellId then
break
elseif not hiddenUnitAuraCollector[spellId] then
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall("BUFF", spellId, name, duration, unit, UnitName(unit)))
if UnitIsVisible(unit) then
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall("DEBUFF", spellId, name, duration, unit, UnitName(unit)))
else -- If it's not visible it may not show up in CLEU, use this as an indicator of a false positive
hiddenUnitAuraCollector[spellId] = strjoin("#", tostringall("DEBUFF", "UNIT_NOT_VISIBLE", spellId, name, duration, unit, UnitName(unit)))
end
end
end
end
Expand Down

0 comments on commit 913fd8c

Please sign in to comment.