Skip to content

Commit

Permalink
fix Range Check by using names again unless it's special
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Apr 7, 2024
1 parent 87ba151 commit c6c5db5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ElvUI_Libraries/Core/LibRangeCheck-3.0/LibRangeCheck-3.0.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ local CheckInteractDistance = CheckInteractDistance
local GetInventoryItemLink = GetInventoryItemLink
local GetItemInfo = GetItemInfo
local GetNumSpellTabs = GetNumSpellTabs
local GetSpellBookItemInfo = GetSpellBookItemInfo
local GetSpellBookItemName = GetSpellBookItemName
local GetSpellInfo = GetSpellInfo
local GetSpellTabInfo = GetSpellTabInfo
local GetTime = GetTime
Expand Down Expand Up @@ -133,6 +133,7 @@ local InteractLists = {
}

local MeleeRange = 2
local MatchSpellByID = {} -- specific matching to avoid incorrect index
local FriendSpells, HarmSpells, ResSpells, PetSpells = {}, {}, {}, {}

for _, n in ipairs({ "EVOKER", "DEATHKNIGHT", "DEMONHUNTER", "DRUID", "HUNTER", "SHAMAN", "MAGE", "PALADIN", "PRIEST", "WARLOCK", "WARRIOR", "MONK", "ROGUE" }) do
Expand Down Expand Up @@ -196,6 +197,8 @@ if not isRetail then
end

if isEraSOD then
MatchSpellByID[401417] = true

tinsert(FriendSpells.MAGE, 401417) -- Regeneration (40 yards)
tinsert(FriendSpells.MAGE, 412510) -- Mass Regeneration (40 yards)
end
Expand Down Expand Up @@ -653,15 +656,14 @@ local function getNumSpells()
end

-- return the spellIndex of the given spell by scanning the spellbook
local allowSpellType = { SPELL = true, FUTURESPELL = true }
local function findSpellIdx(spellName, sid)
if not spellName or spellName == "" then
return nil
end

for i = 1, getNumSpells() do
local spellType, id = GetSpellBookItemInfo(i, BOOKTYPE_SPELL)
if sid == id and allowSpellType[spellType] then
local name, _, id = GetSpellBookItemName(i, BOOKTYPE_SPELL)
if sid == id or (spellName == name and not MatchSpellByID[id]) then
return i
end
end
Expand Down

0 comments on commit c6c5db5

Please sign in to comment.