@@ -3476,7 +3476,7 @@ local name, link, id = GameTooltip:GetItem()
34763476-- SetInventoryItem — full dressed link with enchant + random suffix
34773477GameTooltip :SetInventoryItem (" player" , INVSLOT_BACK )
34783478local name , link , id = GameTooltip :GetItem ()
3479- -- name = "Superior Cloak"
3479+ -- name = "Superior Cloak of the Eagle" -- decorated name, agrees with the link
34803480-- link = "|cff1eff00|Hitem:9805:247:843:0|h[Superior Cloak of the Eagle]|h|r"
34813481-- id = 9805
34823482```
@@ -4430,7 +4430,9 @@ the item's inventory type.
44304430` itemInfo ` accepts the same shapes as
44314431[ ` C_Item.IsEquippedItem ` ] ( #c_itemisequippeditemitem ) — itemID number,
44324432bare ` "item:N" ` string, full chat link, or a localized item name. Name
4433- matches are case-insensitive against the cached ` m_name[0] ` .
4433+ matching is case-insensitive against each candidate's * decorated* name
4434+ (random suffix included — a suffixed item matches its full name, not the
4435+ base), the same shared predicate ` C_Item.IsEquippedItem ` uses.
44344436
44354437Returns nothing. Silently no-ops when:
44364438
@@ -4963,16 +4965,27 @@ after `GET_ITEM_INFO_RECEIVED`.
49634965
49644966### ` C_Item.GetItemName(itemLocation) ` / ` C_Item.GetItemNameByID(item) `
49654967
4966- Returns the cached display name as a string, or ` nil ` for empty /
4967- uncached / invalid inputs. Reads ` m_name[0] ` straight off the
4968- ` ItemStats_C ` cache record (` +0x08 ` ) — no ` GetItemInfo ` round-trip.
4968+ Returns the item's display name as a string, or ` nil ` for empty /
4969+ uncached / invalid inputs.
49694970
4970- Cache miss on the ` ByID ` form returns ` nil ` and fires the cache fill
4971- so the next call (after ` GET_ITEM_INFO_RECEIVED ` ) succeeds.
4971+ The ** location** form points at a live item instance, so it returns the
4972+ * decorated* name — random suffix included (` "Iridium Chain of the Owl" ` ,
4973+ not the base ` "Iridium Chain" ` ) — built off the ` CGItem ` via the engine's
4974+ own name builder, matching modern WoW and the bracketed name in
4975+ [ ` C_Item.GetItemLink ` ] ( #c_itemgetitemlinkitemlocation ) . (It falls back to
4976+ the base ` ItemStats_C.m_name[0] ` name if the instance build yields
4977+ nothing.)
4978+
4979+ The ** ByID** form has no instance — an itemID can't carry a random suffix
4980+ — so it returns the base ` m_name[0] ` name only. Cache miss on the ` ByID `
4981+ form returns ` nil ` and fires the cache fill so the next call (after
4982+ ` GET_ITEM_INFO_RECEIVED ` ) succeeds.
49724983
49734984``` lua
4974- local name = C_Item .GetItemName ({bagID = 0 , slotIndex = 1 })
4975- local name = C_Item .GetItemNameByID (6948 ) -- "Hearthstone"
4985+ -- location form → decorated name (random suffix included)
4986+ local name = C_Item .GetItemName ({equipmentSlotIndex = 2 }) -- "Iridium Chain of the Owl"
4987+ -- ByID form → base name only (no instance → no suffix)
4988+ local name = C_Item .GetItemNameByID (6948 ) -- "Hearthstone"
49764989```
49774990
49784991### ` C_Item.GetItemQuality(itemLocation) ` / ` C_Item.GetItemQualityByID(item) `
@@ -5382,14 +5395,19 @@ short-circuits on the first match.
53825395| itemID | ` 2589 ` | exact ` itemID ` equality |
53835396| bare link | ` "item:2589:0:0:0" ` | parses the first numeric field |
53845397| chat link | ` \124cffffffff\124Hitem:2589:0:0:0\124h[Linen Cloth]\124h\124r ` | extracts itemID after ` \124Hitem: ` |
5385- | name | ` "Linen Cloth" ` | case-insensitive match against the cached ` m_name[0] ` of each equipped item |
5398+ | name | ` "Linen Cloth" ` | case-insensitive match against each equipped item's * decorated * name (random suffix included) |
53865399
53875400Returns ` false ` (no Lua error) for invalid input — ` nil ` , empty string,
53885401or a string that doesn't parse as any of the above.
53895402
5390- The name-match path requires the candidate equipped item to be in the
5391- client item cache; equipped items are always cached, so this is a
5392- non-issue in practice.
5403+ Name matching is against the item's ** decorated** name: a random-suffix
5404+ item matches only its full name (` "Krol Blade of the Bear" ` ), not the
5405+ base (` "Krol Blade" ` ) — the same behavior as modern WoW (verified
5406+ in-game). Unsuffixed items match their plain name. The candidate must be
5407+ in the client item cache; equipped items always are, so that's a non-issue
5408+ in practice. This match logic is shared with the by-name action APIs
5409+ (` C_Item.UseItemByName ` / ` EquipItemByName ` ) — one predicate, one set of
5410+ semantics.
53935411
53945412``` lua
53955413if C_Item .IsEquippedItem (2589 ) then
@@ -5707,8 +5725,9 @@ uses it. Returns nothing; silently no-ops when:
57075725` itemInfo ` accepts the same shapes as
57085726[ ` C_Item.EquipItemByName ` ] ( #c_itemequipitembynameiteminfo--dstslot ) —
57095727itemID number, bare ` "item:N" ` string, full chat link, or a localized
5710- item name. Name matches are case-insensitive against the cached
5711- ` m_name[0] ` .
5728+ item name. Name matching is case-insensitive against each candidate's
5729+ * decorated* name (random suffix included), the same shared predicate
5730+ ` C_Item.IsEquippedItem ` uses.
57125731
57135732The optional ` unit ` argument is a unit token (` "player" ` , ` "target" ` ,
57145733` "focus" ` , ` "partyN" ` , ` "raidN" ` , ` "nameplateN" ` , …) used as the cast
0 commit comments