Skip to content

Commit

Permalink
Update ItemCache
Browse files Browse the repository at this point in the history
  • Loading branch information
Anonomit committed Jul 12, 2024
1 parent a7b447d commit 6aa2a0a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions Libs/ItemCache/ItemCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local ADDON_NAME = "ItemCache"
local HOST_ADDON_NAME, Data = ...
local IsStandalone = ADDON_NAME == HOST_ADDON_NAME

local MAJOR, MINOR = ADDON_NAME, 8
local MAJOR, MINOR = ADDON_NAME, 9
local ItemCache, oldMinor = LibStub:NewLibrary(MAJOR, MINOR)
if not ItemCache and not IsStandalone then
return
Expand Down Expand Up @@ -126,7 +126,7 @@ local MY_CLASS = select(2, UnitClassBase"player")


local CLASS_MAP_TO_ID = {}
for i = 1, GetNumClasses() do
for i = 1, 15 do -- Don't use GetNumClasses() because there are currently gaps between the class IDs
local name, file, id = GetClassInfo(i)
if name then
local maleNames, femaleNames = LOCALIZED_CLASS_NAMES_MALE[file], LOCALIZED_CLASS_NAMES_FEMALE[file]
Expand Down Expand Up @@ -194,7 +194,9 @@ do

if Addon.expansionLevel <= Addon.expansions.tbc then
usableTypes[weapon][subWeapon.Axe1H][ID.ROGUE] = nil
usableTypes[weapon][subWeapon.Polearm][ID.DRUID] = nil

-- druids can now use polearms in era
-- usableTypes[weapon][subWeapon.Polearm][ID.DRUID] = nil
end

local dualWielders = Addon:MakeLookupTable{ID.DEATHKNIGHT, ID.HUNTER, ID.ROGUE, ID.SHAMAN, ID.WARRIOR}
Expand Down Expand Up @@ -1157,6 +1159,16 @@ function Item:GetTypeSubType()
local _, itemType, itemSubType = self:GetInfoInstant()
return itemType, itemSubType
end
function Item:GetClass()
return (select(6, self:GetInfoInstant()))
end
function Item:GetSubClass()
return (select(7, self:GetInfoInstant()))
end
function Item:GetClassSubClass()
local itemClass, itemSubClass = select(6, self:GetInfoInstant())
return itemClass, itemSubClass
end

function Item:GetQuality()
return (select(3, self:GetInfo()))
Expand Down
2 changes: 1 addition & 1 deletion Server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3034,7 +3034,7 @@ function LootReserve.Server:CancelRollRequest(item, winners, noHistory, advancin
smartOverride = LootReserve.Constants.WinnerReservesRemoval.Single;

-- Make sure the item is not unique and is not a quest starter.
elseif not reservedItem:IsUnique() and not item:StartsQuest() and not (reservedItem:GetType() == "Recipe" and reservedItem:GetBindType() == LE_ITEM_BIND_ON_ACQUIRE) then
elseif not reservedItem:IsUnique() and not item:StartsQuest() and not (reservedItem:GetType() == "Recipe" and reservedItem:IsBindOnPickup()) then
-- Players may genuinely want multiple copies of the same ring to equip together.
if reservedItem:GetEquipLocation() == "INVTYPE_FINGER" or reservedItem:GetEquipLocation() == "INVTYPE_TRINKET" then
smartOverride = LootReserve.Constants.WinnerReservesRemoval.Single;
Expand Down
2 changes: 1 addition & 1 deletion Windows/RollRequestWindow.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local function RollRequested(self, sender, item, players, custom, duration, maxD
if not example then
if not self.Settings.RollRequestShow then return; end
if not LootReserve:Contains(players, LootReserve:Me()) then return; end
if custom and not self.Settings.RollRequestShowUnusable and (not LootReserve.ItemConditions:IsItemUsableByMe(item:GetID()) and (not self.Settings.RollRequestShowUnusableBoE or item:GetBindType() == LE_ITEM_BIND_ON_ACQUIRE)) then return; end
if custom and not self.Settings.RollRequestShowUnusable and (not LootReserve.ItemConditions:IsItemUsableByMe(item:GetID()) and (not self.Settings.RollRequestShowUnusableBoE or item:IsBindOnPickup())) then return; end
end

local isFavorite = self:IsFavorite(item:GetID());
Expand Down

0 comments on commit 6aa2a0a

Please sign in to comment.