Skip to content

Commit

Permalink
Updated references to LE_ITEM_* to the enum.
Browse files Browse the repository at this point in the history
Fixes BoEs not being recognized
  • Loading branch information
evil-morfar committed Sep 11, 2024
1 parent 4cf9093 commit 4d07fb1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"tFilter",
"tCompare",
"ContainsIf",
"ITEM_ACCOUNTBOUND_UNTIL_EQUIP"
"ITEM_ACCOUNTBOUND_UNTIL_EQUIP",
"ChatFrame1"
]
}
23 changes: 12 additions & 11 deletions __tests/wow_api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1079,17 +1079,6 @@ TOOLTIP_DEFAULT_BACKGROUND_COLOR = { r = 0.09, g = 0.09, b = 0.19, };
_G.INVSLOT_FIRST_EQUIPPED = 1
_G.INVSLOT_LAST_EQUIPPED = 18
NORMAL_FONT_COLOR = CreateColor(255, 209, 0, 255) --ffd100
NUM_LE_ITEM_QUALITYS = 9
LE_ITEM_QUALITY_POOR = 0
LE_ITEM_QUALITY_COMMON = 1
LE_ITEM_QUALITY_UNCOMMON = 2
LE_ITEM_QUALITY_RARE = 3
LE_ITEM_QUALITY_EPIC = 4
LE_ITEM_QUALITY_LEGENDARY = 5
LE_ITEM_QUALITY_ARTIFACT = 6
LE_ITEM_QUALITY_HEIRLOOM = 7
LE_ITEM_QUALITY_WOW_TOKEN = 8


------------------------------------------
-- Global Strings
Expand Down Expand Up @@ -1242,4 +1231,16 @@ Enum = {
Keystone = 1,
ContextToken = 2,
},
ItemBind = {
None = 0,
OnAcquire = 1,
OnEquip = 2,
OnUse = 3,
Quest = 4,
Unused1 = 5,
Unused2 = 6,
ToWoWAccount = 7,
ToBnetAccount = 8,
ToBnetAccountUntilEquipped = 9,
}
}
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ More info frames is no longer clamped to screen.

- *Selecting an item for "Award Later" during a session will now properly count the item as awarded.*
- *Tier token items are now properly registered as such for usage in more info tooltips.*
- *BoE's are recognized once again.*

# 3.13.1

Expand Down
7 changes: 3 additions & 4 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ function RCLootCouncil:PrepareLootTable(lootTable)
v.subType = subType -- Subtype should be in our locale
v.texture = texture
v.token = itemID and RCTokenTable[itemID]
v.boe = bindType == _G.LE_ITEM_BIND_ON_EQUIP
v.boe = bindType == Enum.ItemBind.OnEquip
v.typeID = typeID
v.subTypeID = subTypeID
v.session = v.session or ses
Expand Down Expand Up @@ -1365,14 +1365,13 @@ end

function RCLootCouncil:IsItemBoE(item)
if not item then return false end
-- Item binding type: 0 - none; 1 - on pickup; 2 - on equip; 3 - on use; 4 - quest.
return select(14, C_Item.GetItemInfo(item)) == LE_ITEM_BIND_ON_EQUIP
return select(14, C_Item.GetItemInfo(item)) == Enum.ItemBind.OnEquip
end

function RCLootCouncil:IsItemBoP(item)
if not item then return false end
-- Item binding type: 0 - none; 1 - on pickup; 2 - on equip; 3 - on use; 4 - quest.
return select(14, C_Item.GetItemInfo(item)) == LE_ITEM_BIND_ON_ACQUIRE
return select(14, C_Item.GetItemInfo(item)) == Enum.ItemBind.OnAcquire
end

function RCLootCouncil:GetPlayersGuildRank()
Expand Down
2 changes: 1 addition & 1 deletion ml_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ function RCLootCouncilML:CanGiveLoot(slot, item, winner)
local bindType = select(14, C_Item.GetItemInfo(item))

if not found then
if bindType ~= LE_ITEM_BIND_ON_ACQUIRE then
if bindType ~= Enum.ItemBind.OnAcquire then
return false, "not_bop"
else
return false, "not_ml_candidate"
Expand Down

0 comments on commit 4d07fb1

Please sign in to comment.