Skip to content

Commit 87f257e

Browse files
committed
Update CLEU handling logic
1 parent fcd2372 commit 87f257e

File tree

2 files changed

+49
-32
lines changed

2 files changed

+49
-32
lines changed

.vscode/settings.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"Lua.runtime.version": "Lua 5.1",
3+
"Lua.runtime.builtin": {
4+
"basic": "disable",
5+
"debug": "disable",
6+
"io": "disable",
7+
"math": "disable",
8+
"os": "disable",
9+
"package": "disable",
10+
"string": "disable",
11+
"table": "disable",
12+
"utf8": "disable"
13+
},
14+
"Lua.workspace.library": [
15+
"~\\.vscode\\extensions\\ketho.wow-api-0.18.2\\Annotations"
16+
]
17+
}

NameplateSCT.lua

+32-32
Original file line numberDiff line numberDiff line change
@@ -752,26 +752,7 @@ function NameplateSCT:CombatFilter(_, clue, _, sourceGUID, _, sourceFlags, _, de
752752
if playerGUID == sourceGUID or (NameplateSCT.db.global.personal and playerGUID == destGUID) then -- Player events
753753
local destUnit = guidToUnit[destGUID]
754754
if (destUnit) or (destGUID == playerGUID and NameplateSCT.db.global.personal) then
755-
if string.find(clue, "_DAMAGE") or string.find(clue, "DAMAGE_SHIELD") then
756-
local spellName, amount, overkill, school, critical, spellId, absorbed
757-
if (string.find(clue, "SWING")) then
758-
spellName, amount, overkill, _, _, _, absorbed, critical = "melee", ...
759-
elseif (string.find(clue, "ENVIRONMENTAL")) then
760-
spellName, amount, overkill, school, _, _, absorbed, critical = ...
761-
else
762-
spellId, spellName, _, amount, overkill, school, _, _, absorbed, critical = ...
763-
end
764-
if spellId and spellId == 0 then
765-
spellId = nil -- Don't pass spellId 0
766-
end
767-
if NameplateSCT.db.global.filterEnabled then
768-
local spellInFilter = filtersTable[tostring(spellId)] or filtersTable[spellName]
769-
if (NameplateSCT.db.global.inverseSpellFilter and not spellInFilter) or (not NameplateSCT.db.global.inverseSpellFilter and spellInFilter) then
770-
return
771-
end
772-
end
773-
self:DamageEvent(destGUID, spellName, amount, overkill, school, critical, spellId, absorbed)
774-
elseif(string.find(clue, "_MISSED")) then
755+
if string.find(clue, "_MISSED") then
775756
local spellName, missType, spellId, amount, school
776757

777758
if (string.find(clue, "SWING")) then
@@ -797,19 +778,14 @@ function NameplateSCT:CombatFilter(_, clue, _, sourceGUID, _, sourceFlags, _, de
797778
else
798779
self:MissEvent(destGUID, spellName, missType, spellId)
799780
end
800-
end
801-
end
802-
elseif (bit.band(sourceFlags, COMBATLOG_OBJECT_TYPE_GUARDIAN) > 0 or bit.band(sourceFlags, COMBATLOG_OBJECT_TYPE_PET) > 0) and bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then -- Pet/Guardian events
803-
local destUnit = guidToUnit[destGUID]
804-
if (destUnit) or (destGUID == playerGUID and NameplateSCT.db.global.personal) then
805-
if string.find(clue, "_DAMAGE") or string.find(clue, "DAMAGE_SHIELD") then
806-
local spellName, amount, overkill, critical, spellId, absorbed
781+
elseif string.find(clue, "_DAMAGE") or string.find(clue, "DAMAGE_SHIELD") then -- After _MISSED to not catch SPELL_DAMAGE_SHIELD_MISSED
782+
local spellName, amount, overkill, school, critical, spellId, absorbed
807783
if (string.find(clue, "SWING")) then
808-
spellName, amount, overkill, _, _, _, absorbed, critical, _, _, _ = "pet", ...
784+
spellName, amount, overkill, _, _, _, absorbed, critical = "melee", ...
809785
elseif (string.find(clue, "ENVIRONMENTAL")) then
810-
spellName, amount, overkill, _, _, _, absorbed, critical= ...
786+
spellName, amount, overkill, school, _, _, absorbed, critical = ...
811787
else
812-
spellId, spellName, _, amount, overkill, _, _, _, absorbed, critical = ...
788+
spellId, spellName, _, amount, overkill, school, _, _, absorbed, critical = ...
813789
end
814790
if spellId and spellId == 0 then
815791
spellId = nil -- Don't pass spellId 0
@@ -820,8 +796,13 @@ function NameplateSCT:CombatFilter(_, clue, _, sourceGUID, _, sourceFlags, _, de
820796
return
821797
end
822798
end
823-
self:DamageEvent(destGUID, spellName, amount, overkill, "pet", critical, spellId, absorbed)
824-
elseif(string.find(clue, "_MISSED")) then -- Check for absorbed damage
799+
self:DamageEvent(destGUID, spellName, amount, overkill, school, critical, spellId, absorbed)
800+
end
801+
end
802+
elseif (bit.band(sourceFlags, COMBATLOG_OBJECT_TYPE_GUARDIAN) > 0 or bit.band(sourceFlags, COMBATLOG_OBJECT_TYPE_PET) > 0) and bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_MINE) > 0 then -- Pet/Guardian events
803+
local destUnit = guidToUnit[destGUID]
804+
if (destUnit) or (destGUID == playerGUID and NameplateSCT.db.global.personal) then
805+
if string.find(clue, "_MISSED") then
825806
local spellName, missType, spellId, amount
826807

827808
if (string.find(clue, "SWING")) then
@@ -845,6 +826,25 @@ function NameplateSCT:CombatFilter(_, clue, _, sourceGUID, _, sourceFlags, _, de
845826
if missType == "ABSORB" then
846827
self:DamageEvent(destGUID, spellName, 0, -1, "pet", critical, spellId, amount)
847828
end
829+
elseif string.find(clue, "_DAMAGE") or string.find(clue, "DAMAGE_SHIELD") then -- After _MISSED to not catch SPELL_DAMAGE_SHIELD_MISSED
830+
local spellName, amount, overkill, critical, spellId, absorbed
831+
if (string.find(clue, "SWING")) then
832+
spellName, amount, overkill, _, _, _, absorbed, critical, _, _, _ = "pet", ...
833+
elseif (string.find(clue, "ENVIRONMENTAL")) then
834+
spellName, amount, overkill, _, _, _, absorbed, critical= ...
835+
else
836+
spellId, spellName, _, amount, overkill, _, _, _, absorbed, critical = ...
837+
end
838+
if spellId and spellId == 0 then
839+
spellId = nil -- Don't pass spellId 0
840+
end
841+
if NameplateSCT.db.global.filterEnabled then
842+
local spellInFilter = filtersTable[tostring(spellId)] or filtersTable[spellName]
843+
if (NameplateSCT.db.global.inverseSpellFilter and not spellInFilter) or (not NameplateSCT.db.global.inverseSpellFilter and spellInFilter) then
844+
return
845+
end
846+
end
847+
self:DamageEvent(destGUID, spellName, amount, overkill, "pet", critical, spellId, absorbed)
848848
end
849849
end
850850
end

0 commit comments

Comments
 (0)