From e9f3737a06d64678619ba09b5b8205e251c922b2 Mon Sep 17 00:00:00 2001 From: Kyle Buller Date: Thu, 14 Jan 2021 19:32:03 -0600 Subject: [PATCH] Aura: Fix custom visibility filters for temp enchants Fixes WH-1312 --- Modules/Aura/FilterTypes.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Modules/Aura/FilterTypes.lua b/Modules/Aura/FilterTypes.lua index 74bc092b..1c2d6d2b 100755 --- a/Modules/Aura/FilterTypes.lua +++ b/Modules/Aura/FilterTypes.lua @@ -1485,8 +1485,11 @@ PitBull4_Aura:RegisterFilterType('Self buff',L["Self buff"],self_buff_filter,fun end) local function has_custom_visibility_filter(self, entry, frame) - local state = UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT" - local hasCustom = SpellGetVisibilityInfo(entry[15], state) + local hasCustom = false + if entry[15] then + local state = UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT" + hasCustom = SpellGetVisibilityInfo(entry[15], state) + end if PitBull4_Aura:GetFilterDB(self).custom_visibility then return hasCustom else @@ -1517,9 +1520,12 @@ PitBull4_Aura:RegisterFilterType('Has custom visibility',L["Has custom visibilit end) local function should_show_filter(self, entry, frame) - local state = UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT" - local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(entry[15], state) - local show = hasCustom and (showForMySpec or (alwaysShowMine and my_units[entry[12]])) + local show = false + if entry[15] then + local state = UnitAffectingCombat("player") and "RAID_INCOMBAT" or "RAID_OUTOFCOMBAT" + local hasCustom, alwaysShowMine, showForMySpec = SpellGetVisibilityInfo(entry[15], state) + show = hasCustom and (showForMySpec or (alwaysShowMine and my_units[entry[12]])) + end if PitBull4_Aura:GetFilterDB(self).should_show then return show else