From 0531c8ac7a8d97bcbcf1a27e5f7a07a6e1032066 Mon Sep 17 00:00:00 2001 From: Buds Date: Wed, 24 Jul 2024 14:09:43 +0200 Subject: [PATCH] Fix error with IsSpellBookItemInRange when loadDepractionFallbacks cvar is enable Fixes #26 --- LibRangeCheck-3.0/LibRangeCheck-3.0.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LibRangeCheck-3.0/LibRangeCheck-3.0.lua b/LibRangeCheck-3.0/LibRangeCheck-3.0.lua index 331338c..0070fae 100644 --- a/LibRangeCheck-3.0/LibRangeCheck-3.0.lua +++ b/LibRangeCheck-3.0/LibRangeCheck-3.0.lua @@ -40,7 +40,7 @@ License: MIT -- @class file -- @name LibRangeCheck-3.0 local MAJOR_VERSION = "LibRangeCheck-3.0" -local MINOR_VERSION = 19 +local MINOR_VERSION = 20 ---@class lib local lib, oldminor = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) @@ -86,6 +86,10 @@ local IsSpellInRange = _G.IsSpellInRange or function(id, unit) return nil end local IsSpellBookItemInRange = _G.IsSpellInRange or function(index, spellBank, unit) + -- Deprecated_11_0_0.lua set BOOKTYPE_SPELL to "spell" but doesn't provide a compatibility wrapper for IsSpellBookItemInRange + if type(spellBank) == "string" then + spellBank = (spellBank == "spell") and Enum.SpellBookSpellBank.Player or Enum.SpellBookSpellBank.Pet; + end local result = C_SpellBook.IsSpellBookItemInRange(index, spellBank, unit) if result == true then return 1