Skip to content

Commit

Permalink
Classic Era healers remove by key instead of value
Browse files Browse the repository at this point in the history
  • Loading branch information
mikfhan committed Jan 16, 2023
1 parent f8b1055 commit 8e3f52c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions NamePlatesThreat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,12 @@ NPT:SetScript("OnEvent", function(self, event, arg1)
NPT.playerRole = "HEALER"
end
else
for _, unit in ipairs(NPT.nonTanks) do
local key, unit
for key, unit in pairs(NPT.nonTanks) do
if sourceGUID == UnitGUID(unit) then
--print(unit .. " is now HEALER")
table.insert(NPT.offHeals, unit)
table.remove(NPT.nonTanks, unit)
table.remove(NPT.nonTanks, key)
break
end
end
Expand All @@ -732,11 +733,12 @@ NPT:SetScript("OnEvent", function(self, event, arg1)
NPT.playerRole = "DAMAGER"
end
else
for _, unit in ipairs(NPT.offHeals) do
local key, unit
for key, unit in pairs(NPT.offHeals) do
if sourceGUID == UnitGUID(unit) then
--print(unit .. " is now DAMAGER")
table.insert(NPT.nonTanks, unit)
table.remove(NPT.offHeals, unit)
table.remove(NPT.offHeals, key)
break
end
end
Expand Down

0 comments on commit 8e3f52c

Please sign in to comment.