From 14dc227c86aac0050e059d645b7e845f0ecc96c8 Mon Sep 17 00:00:00 2001 From: Sumsebrum Date: Sun, 31 Jul 2022 18:14:38 +0200 Subject: [PATCH] GetArenaUnit add unify parameter --- Util.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Util.lua b/Util.lua index 154dea0..2f8b94b 100644 --- a/Util.lua +++ b/Util.lua @@ -160,13 +160,22 @@ function Gladdy:isFeignDeath(unit) return AuraUtil.FindAuraByName(feignDeath, unit) end -function Gladdy:GetArenaUnit(unitCaster) +function Gladdy:GetArenaUnit(unitCaster, unify) if unitCaster then for i=1,5 do local arenaUnit = "arena" .. i local arenaUnitPet = "arenapet" .. i - if unitCaster and (UnitIsUnit(arenaUnit, unitCaster) or UnitIsUnit(arenaUnitPet, unitCaster)) then - return arenaUnit + if unify then + if unitCaster and (UnitIsUnit(arenaUnit, unitCaster) or UnitIsUnit(arenaUnitPet, unitCaster)) then + return arenaUnit + end + else + if unitCaster and UnitIsUnit(arenaUnit, unitCaster) then + return arenaUnit + end + if unitCaster and UnitIsUnit(arenaUnitPet, unitCaster) then + return arenaUnitPet + end end end end