Files
ClassicAPI/src
Brues 6feb62f884 GetInventoryItemsForSlot
Modern accessor for "all items in inventory that can equip in
slot N". Walks equipment 1..19 + bags 0..4; for each item whose
m_inventoryType passes the slot-compatibility check, inserts
returnTable[packedLocation] = itemLink. Uses the same packed
ItemLocation encoding as C_EquipmentSet.GetItemLocations.

Compatibility check is a single bitwise AND against a static
invType → slotMask table — same shape and values as 3.3.5's at
DAT_00A2D288 (decoded from its Script_GetInventoryItemsForSlot
chain via FUN_007082B0). Two adjustments for vanilla:

  INVTYPE_2HWEAPON       → mainhand only (no titanic grip)
  INVTYPE_WEAPONMAINHAND → mainhand only
  INVTYPE_WEAPONOFFHAND  → offhand only

3.3.5's table allowed either-hand for those three because of
later-expansion mechanics.

Implementation gotcha: Item::Location::ResolveBag does
SetTop(L, 0) internally (it needs to set up the engine's
PackBagSlot expected stack shape), which clobbers our returnTable
at slot 2. Fix: anchor the table in the Lua registry under a
private key, collect items into a std::vector during the walk,
then rebuild the stack and populate. Registry slot is cleaned up
before return.

Bank items aren't included — vanilla's GetItemBySlot gates bank
slots on a banker GUID that's only set while the bank window is
open; modern WoW behaves the same way.

The transmogrify arg is accepted and ignored. Stock 1.12 has no
transmog system to query, and the modern flag's effect (broader
cross-eligibility for visual swaps) reduces to the regular equip
check. Private servers (Turtle WoW etc.) layer their own transmog
systems on top of vanilla; if any of those exposes its rules
through addon-readable engine state we'd plumb the flag through,
but we don't know of any such hook today.
2026-05-21 22:08:15 -05:00
..
2026-05-14 14:24:11 -05:00
2026-05-09 22:15:14 -05:00
2026-05-14 14:24:11 -05:00
2026-05-17 20:50:10 -05:00
2026-05-19 18:30:13 -05:00
2026-05-19 17:32:53 -05:00
2026-05-21 22:08:15 -05:00
2026-05-21 00:25:20 -05:00
2026-05-16 17:58:07 -05:00
2026-05-12 21:51:46 -05:00
2026-05-14 14:24:11 -05:00
2026-05-21 15:17:02 -05:00
2026-05-07 10:47:34 -05:00