Skip to content

Commit

Permalink
Fix Filter Range by Spell option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hekili committed Nov 20, 2023
1 parent 9cf28e4 commit 8d909d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dragonflight/PaladinRetribution.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2013,7 +2013,7 @@ spec:RegisterAbilities( {
},
} )

spec:RegisterRanges( "crusader_strike", "hammer_of_justice", "blade_of_justice", "hammer_of_wrath" )
spec:RegisterRanges( "hammer_of_justice", "rebuke", "crusader_strike", "blade_of_justice", "hammer_of_wrath" )

spec:RegisterOptions( {
enabled = true,
Expand All @@ -2022,7 +2022,7 @@ spec:RegisterOptions( {
cycle = false,

nameplates = true,
rangeChecker = "crusader_strike",
rangeChecker = "rebuke",
rangeFilter = false,

damage = true,
Expand Down
12 changes: 6 additions & 6 deletions Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5065,7 +5065,7 @@ do
width = "full"
},

rangeCheck = {
rangeChecker = {
type = "select",
name = "Range Filter by Spell",
desc = "When |cFFFFD100Count Targets by Nameplates|r is enabled, enemies within range of this ability will be included in target counts.\n\n"
Expand Down Expand Up @@ -5098,23 +5098,23 @@ do
end,
get = function()
-- If it's blank, default to the first option.
if spec.ranges and not self.DB.profile.specs[ id ].rangeCheck then
self.DB.profile.specs[ id ].rangeCheck = spec.ranges[ 1 ]
if spec.ranges and not self.DB.profile.specs[ id ].rangeChecker then
self.DB.profile.specs[ id ].rangeChecker = spec.ranges[ 1 ]
else
local found = false
for k, v in pairs( spec.ranges ) do
if v == self.DB.profile.specs[ id ].rangeCheck then
if v == self.DB.profile.specs[ id ].rangeChecker then
found = true
break
end
end

if not found then
self.DB.profile.specs[ id ].rangeCheck = spec.ranges[ 1 ]
self.DB.profile.specs[ id ].rangeChecker = spec.ranges[ 1 ]
end
end

return self.DB.profile.specs[ id ].rangeCheck
return self.DB.profile.specs[ id ].rangeChecker
end,
disabled = function()
return self.DB.profile.specs[ id ].rangeFilter
Expand Down
4 changes: 3 additions & 1 deletion Targets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ do
checkPlates = checkPlates and ( spec.rangeChecker or class.specs[ state.spec.id ].ranges[ 1 ] )
checkPlates = checkPlates and class.abilities[ checkPlates ].id

if not IsSpellKnown( checkPlates ) then checkPlates = false end

--[[ if rangeCheck == "Auto" then
rangeChecker = spec.ranges.Auto[2]
rangeCheck = true
Expand Down Expand Up @@ -526,7 +528,7 @@ do
end
end

if not spec or spec.damage or ( not spec.nameplates and not spec.petbased ) or not showNPs then
if not spec or spec.damage or not checkPets and not checkPlates then
local db = spec and (spec.myTargetsOnly and myTargets or targets) or targets

for guid, seen in pairs(db) do
Expand Down

0 comments on commit 8d909d5

Please sign in to comment.