Skip to content

Commit

Permalink
Fix Magic Broom
Browse files Browse the repository at this point in the history
  • Loading branch information
kstange committed Oct 31, 2024
1 parent 9770191 commit f150d92
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 11.0.5.1

- Fixed handling of temporary mounts like Magic Broom that can't be collected

# Version 11.0.5.0

- Updated TOC for Retail 11.0.5
Expand Down
28 changes: 16 additions & 12 deletions DataFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -288,20 +288,24 @@ function Data:GetCollectable(link, itemdata)
-- This is a mount, let's see if we know it
elseif subclass == Enum.ItemMiscellaneousSubclass.Mount then
local mountid = C_MountJournal.GetMountFromItem(itemid)
local mountinfo = { C_MountJournal.GetMountInfoByID(mountid) }
if mountid then
local mountinfo = { C_MountJournal.GetMountInfoByID(mountid) }

-- This field could move; look for isCollected index
-- If collected, then we know it, if it's usable we can collect it, otherwise
-- we probably can't collect it yet
--
-- It's possible we could find a merchant mount that isn't collectable by this
-- character (class or faction locked), but I didn't find any examples to test
if mountinfo[11] then
item.collectable = Data.CollectableState.Known
elseif itemdata.isUsable then
item.collectable = Data.CollectableState.Collectable
-- This field could move; look for isCollected index
-- If collected, then we know it, if it's usable we can collect it, otherwise
-- we probably can't collect it yet
--
-- It's possible we could find a merchant mount that isn't collectable by this
-- character (class or faction locked), but I didn't find any examples to test
if mountinfo[11] then
item.collectable = Data.CollectableState.Known
elseif itemdata.isUsable then
item.collectable = Data.CollectableState.Collectable
else
item.collectable = Data.CollectableState.Restricted
end
else
item.collectable = Data.CollectableState.Restricted
trace("logic: GetCollectable: item in mount category was not collectable", itemid)
end

-- This could be anything! We'll have to just try to figure out what it is
Expand Down

0 comments on commit f150d92

Please sign in to comment.