Skip to content

Commit

Permalink
- resetting range check values if needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
cont1nuity committed Nov 19, 2023
1 parent 7e103fa commit b0bd608
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions Plater_ChangeLog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function Plater.GetChangelogTable()
if (not Plater.ChangeLogTable) then
Plater.ChangeLogTable = {

{1700257286, "Backend Change", "November 19th, 2023", "Resetting range check ranges where they are no longer set properly due to backend changes.", "cont1nuity"},
{1700257286, "Backend Change", "November 17th, 2023", "Switch to LibRangeCheck-3.0 with combat range detection.", "cont1nuity"},
{1700257286, "Hotfix", "November 17th, 2023", "Cleaning up hotfix.", "cont1nuity"},
{1700257286, "Hotfix", "November 16th, 2023", "Fixes for broken range check API, which was prohibited in combat by Blizzard.", "Terciob"},
Expand Down
50 changes: 50 additions & 0 deletions Plater_ScriptLibrary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,56 @@ do
end
end
})

--#33 Reset range check values if necessary....
tinsert (PlaterPatchLibrary, {
NotEssential = false,

Notes = {
"- Reset range check distance settings if necessary."
},
Func = function()
--range check spells
local LibRangeCheck = LibStub:GetLibrary ("LibRangeCheck-3.0")
LibRangeCheck.RegisterCallback(PlaterPatchLibrary, LibRangeCheck.CHECKERS_CHANGED, function()
local harmCheckers = {}
for range, func in LibRangeCheck:GetHarmCheckers(true) do
harmCheckers[range] = func
end
local friendCheckers = {}
for range, func in LibRangeCheck:GetFriendCheckers(true) do
friendCheckers[range] = func
end
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
for specID, _ in pairs (Plater.SpecList [select (2, UnitClass ("player"))]) do
if harmCheckers then
if (PlaterDBChr.spellRangeCheckRangeEnemy [specID] == nil or not harmCheckers[PlaterDBChr.spellRangeCheckRangeEnemy [specID]]) then
PlaterDBChr.spellRangeCheckRangeEnemy [specID] = Plater.DefaultSpellRangeList [specID]
end
end
if friendCheckers then
if (PlaterDBChr.spellRangeCheckRangeFriendly [specID] == nil or not friendCheckers[PlaterDBChr.spellRangeCheckRangeFriendly [specID]]) then
PlaterDBChr.spellRangeCheckRangeFriendly [specID] = Plater.DefaultSpellRangeListF [specID]
end
end
end
else
local playerClass = select (3, UnitClass ("player"))
if harmCheckers then
if (PlaterDBChr.spellRangeCheckRangeEnemy [playerClass] == nil or not harmCheckers[PlaterDBChr.spellRangeCheckRangeEnemy [playerClass]]) then
PlaterDBChr.spellRangeCheckRangeEnemy [playerClass] = Plater.DefaultSpellRangeList [playerClass]
end
end
if friendCheckers then
if (PlaterDBChr.spellRangeCheckRangeFriendly [playerClass] == nil or not friendCheckers[PlaterDBChr.spellRangeCheckRangeFriendly [playerClass]]) then
PlaterDBChr.spellRangeCheckRangeFriendly [playerClass] = Plater.DefaultSpellRangeListF [playerClass]
end
end
end
Plater.GetSpellForRangeCheck()
end)
end
})

--to tag an update as non-essential, add "NotEssential = true," to the table
--/run Plater.db.profile.patch_version = 30
Expand Down

0 comments on commit b0bd608

Please sign in to comment.