Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tweaks #788

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ function R:GetDistanceToItem(item)
local map = v.m
local x = (v.x or 50) / 100
local y = (v.y or 50) / 100
local itemWorldX, itemWorldY = hbd:GetWorldCoordinatesFromZone(x, y, map, v.f or 1)
local itemWorldX, itemWorldY = hbd:GetWorldCoordinatesFromZone(x, y, map)
if itemWorldX ~= nil then -- Library returns nil for instances
local thisDistance =
hbd:GetWorldDistance(instance, itemWorldX, itemWorldY, playerWorldX, playerWorldY)
Expand All @@ -474,7 +474,7 @@ end
-- Prepares a set of lookup tables to let us quickly determine if we're interested in various things.
-- Many of the events we handle fire quite frequently, so speed is of the essence.
-- Any item that is not enabled for tracking won't show up in these lists.
function R:UpdateInterestingThings()
function R:UpdateInterestingThings(...)
self:Debug("Updating interesting things tables")

-- Store an internal table listing every MapID
Expand Down
16 changes: 10 additions & 6 deletions Core/Collections.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local R = Rarity
local CONSTANTS = addonTable.constants

-- Lua APIs
local _G = getfenv(0)
local pairs = pairs
local type = type
local select = select
Expand Down Expand Up @@ -370,12 +371,15 @@ function R:ScanArchProjects(reason)
return
end
for race_id = 1, GetNumArchaeologyRaces() do
local name = GetActiveArtifactByRace(race_id)
if Rarity.architems[name] then
-- We started a project we were looking for!
local id = Rarity.architems[name].itemId
if id then
self:OnItemFound(id, Rarity.items[id])
local num_artifacts = GetNumArtifactsByRace(race_id)
for artifact_id = 1, num_artifacts do
local name = GetActiveArtifactByRace(race_id, artifact_id)
if Rarity.architems[name] then
-- We started a project we were looking for!
local id = Rarity.architems[name].itemId
if id then
self:OnItemFound(id, Rarity.items[id])
end
end
end
end
Expand Down