Skip to content

Commit 3b35eee

Browse files
committed
Cleanup: Remove GetDistanceToItem and HereBeDragons-2.0
This function hasn't been used, or even referenced, since at least 2018.
1 parent b097671 commit 3b35eee

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

.pkgmeta

-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ externals:
6868
Libs/LibBabble-Boss-3.0:
6969
url: https://repos.wowace.com/wow/libbabble-boss-3-0/trunk
7070
tag: latest
71-
Libs/HereBeDragons-2.0:
72-
url: git://git.wowace.com/wow/herebedragons/mainline.git
73-
tag: latest
7471
Libs/LibCompress:
7572
url: https://repos.wowace.com/wow/libcompress/trunk
7673
tag: latest

Core.lua

-29
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ local R = Rarity
55
local lbz = LibStub("LibBabble-Zone-3.0"):GetUnstrictLookupTable()
66
local lbsz = LibStub("LibBabble-SubZone-3.0"):GetUnstrictLookupTable()
77
local lbb = LibStub("LibBabble-Boss-3.0"):GetUnstrictLookupTable()
8-
local hbd = LibStub("HereBeDragons-2.0")
98

109
---
1110

@@ -443,34 +442,6 @@ function R:tcopy(to, from)
443442
end
444443
end
445444

446-
-- Location/Distance/Zone
447-
function R:GetDistanceToItem(item)
448-
local distance = 999999999
449-
if item and type(item) == "table" and item.coords and type(item.coords) == "table" then
450-
local playerWorldX, playerWorldY, instance = hbd:GetPlayerWorldPosition()
451-
for k, v in pairs(item.coords) do
452-
if v and type(v) == "table" and v.m and v.i ~= true then
453-
local map = v.m
454-
local x = (v.x or 50) / 100
455-
local y = (v.y or 50) / 100
456-
local itemWorldX, itemWorldY = hbd:GetWorldCoordinatesFromZone(x, y, map, v.f or 1)
457-
if itemWorldX ~= nil then -- Library returns nil for instances
458-
local thisDistance =
459-
hbd:GetWorldDistance(instance, itemWorldX, itemWorldY, playerWorldX, playerWorldY)
460-
-- R:Print("map: "..map..", x: "..x..", y: "..y..", itemWorldX: "..itemWorldX..", itemWorldY: "..itemWorldY..", playerWorldX: "..playerWorldX..", playerWorldY: "..playerWorldY..", thisDistance: "..thisDistance)
461-
if thisDistance < distance then
462-
distance = thisDistance
463-
end
464-
end
465-
end
466-
end
467-
end
468-
if distance ~= 999999999 then
469-
return distance
470-
end
471-
return nil
472-
end
473-
474445
-- Prepares a set of lookup tables to let us quickly determine if we're interested in various things.
475446
-- Many of the events we handle fire quite frequently, so speed is of the essence.
476447
-- Any item that is not enabled for tracking won't show up in these lists.

Rarity.toc

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
## AddonCompartmentFuncOnLeave: Rarity_OnAddonCompartmentLeave
2323
## IconTexture: Interface\Icons\spell_nature_forceofnature.blp
2424

25-
## OptionalDeps: Ace3,LibDualSpec-1.0,LibQTip-1.0,LibDBIcon-1.0,LibBabble-Zone-3.0,LibSink-2.0,LibBabble-SubZone-3.0,LibSharedMedia-3.0,AceGUI-3.0-SharedMediaWidgets,LibBabble-CreatureType-3.0,LibBabble-Boss-3.0,HereBeDragons
25+
## OptionalDeps: Ace3,LibDualSpec-1.0,LibQTip-1.0,LibDBIcon-1.0,LibBabble-Zone-3.0,LibSink-2.0,LibBabble-SubZone-3.0,LibSharedMedia-3.0,AceGUI-3.0-SharedMediaWidgets,LibBabble-CreatureType-3.0,LibBabble-Boss-3.0
2626
## SavedVariables: RarityDB
2727
## X-LoadOn-Always: delayed
2828
#@no-lib-strip@
@@ -49,7 +49,6 @@ Libs\LibSharedMedia-3.0\lib.xml
4949
Libs\AceGUI-3.0-SharedMediaWidgets\widget.xml
5050
Libs\LibBabble-CreatureType-3.0\lib.xml
5151
Libs\LibBabble-Boss-3.0\lib.xml
52-
Libs\HereBeDragons-2.0\HereBeDragons-2.0.lua
5352
Libs\LibCompress\lib.xml
5453
#@end-no-lib-strip@
5554
Libs\LibBars-1.0\lib.xml

0 commit comments

Comments
 (0)