Commit 9aedf650 authored by Blazeflack's avatar Blazeflack

Fixed a logic error in the num:targeting tag.

parent a33a9fd0
## Interface: 60200
## Author: Blazeflack
## Version: 1.01
## Version: 1.02
## Title: |cff1784d1ElvUI|r |cff4beb2cCustomTags|r
## Notes: A collection of custom unitframe tags requested by users.
## RequiredDeps: ElvUI
......
......@@ -22,14 +22,20 @@ local UnitIsUnit = UnitIsUnit
ElvUF.Tags.Events['num:targeting'] = "UNIT_TARGET PLAYER_TARGET_CHANGED GROUP_ROSTER_UPDATE"
ElvUF.Tags.Methods['num:targeting'] = function(unit)
if not IsInGroup() then return "" end
local targetedByNum = 0
--Count the amount of other people targeting the unit
for i = 1, GetNumGroupMembers() do
local groupUnit = (IsInRaid() and "raid"..i or "party"..i);
if (UnitIsUnit(groupUnit.."target", unit) and not UnitIsUnit(groupUnit, "player")) or UnitIsUnit("playertarget", unit) then
if (UnitIsUnit(groupUnit.."target", unit) and not UnitIsUnit(groupUnit, "player")) then
targetedByNum = targetedByNum + 1
end
end
--Add 1 if we're targeting the unit too
if UnitIsUnit("playertarget", unit) then
targetedByNum = targetedByNum + 1
end
return (targetedByNum > 0 and targetedByNum or "")
end
\ No newline at end of file
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