diff --git a/LibRangeCheck-3.0/LibRangeCheck-3.0.lua b/LibRangeCheck-3.0/LibRangeCheck-3.0.lua index 8a16081..c58fbc3 100644 --- a/LibRangeCheck-3.0/LibRangeCheck-3.0.lua +++ b/LibRangeCheck-3.0/LibRangeCheck-3.0.lua @@ -50,6 +50,13 @@ end local isRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE local isWrath = WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC +local InCombatLockdownRestriction +if isRetail then + InCombatLockdownRestriction = InCombatLockdown +else + InCombatLockdownRestriction = function() return false end +end + local _G = _G local next = next local sort = sort @@ -555,7 +562,7 @@ end local checkers_Item = setmetatable({}, { __index = function(t, item) local func = function(unit) - if InCombatLockdown() then + if InCombatLockdownRestriction() then return nil else return IsItemInRange(item, unit) or nil @@ -568,7 +575,7 @@ local checkers_Item = setmetatable({}, { local checkers_Interact = setmetatable({}, { __index = function(t, index) local func = function(unit) - if InCombatLockdown() then + if InCombatLockdownRestriction() then return nil else return CheckInteractDistance(unit, index) and true or false @@ -750,20 +757,20 @@ local function getRange(unit, noItems) local canAssist = UnitCanAssist("player", unit) if UnitIsDeadOrGhost(unit) then if canAssist then - return getRangeWithCheckerList(unit, InCombatLockdown() and lib.resRCInCombat or lib.resRC) + return getRangeWithCheckerList(unit, InCombatLockdownRestriction() and lib.resRCInCombat or lib.resRC) else - return getRangeWithCheckerList(unit, InCombatLockdown() and lib.miscRCInCombat or lib.miscRC) + return getRangeWithCheckerList(unit, InCombatLockdownRestriction() and lib.miscRCInCombat or lib.miscRC) end end if UnitCanAttack("player", unit) then - if InCombatLockdown() then + if InCombatLockdownRestriction() then return getRangeWithCheckerList(unit, noItems and lib.harmNoItemsRCInCombat or lib.harmRCInCombat) else return getRangeWithCheckerList(unit, noItems and lib.harmNoItemsRC or lib.harmRC) end elseif UnitIsUnit("pet", unit) then - if InCombatLockdown() then + if InCombatLockdownRestriction() then local minRange, maxRange = getRangeWithCheckerList(unit, noItems and lib.friendNoItemsRCInCombat or lib.friendRCInCombat) if minRange or maxRange then return minRange, maxRange @@ -779,13 +786,13 @@ local function getRange(unit, noItems) end end elseif canAssist then - if InCombatLockdown() then + if InCombatLockdownRestriction() then return getRangeWithCheckerList(unit, noItems and lib.friendNoItemsRCInCombat or lib.friendRCInCombat) else return getRangeWithCheckerList(unit, noItems and lib.friendNoItemsRC or lib.friendRC) end else - return getRangeWithCheckerList(unit, InCombatLockdown() and lib.miscRC or lib.miscRCInCombat) + return getRangeWithCheckerList(unit, InCombatLockdownRestriction() and lib.miscRC or lib.miscRCInCombat) end end @@ -1594,7 +1601,7 @@ function lib:updateMeasurements() self.lastMeasurements[key] = curr end end - if not InCombatLockdown() then + if not InCombatLockdownRestriction() then for i, v in pairs(DefaultInteractList) do local key = "interact: " .. i local last = self.lastMeasurements[key]