Adopt ClassicAPI accessors: cursor, item IDs, spell mechanic

Lean on ClassicAPI's backported readers instead of link-string parsing
and a hand-maintained mechanic table.

- ClassicAPI.lua: add wrappers GetCursorInfo/CursorHoldsItemID,
  GetContainerItemID, GetInventoryItemID, and GetSpellMechanicByID.
- Core.lua: in the manual equip fallback, verify the cursor holds the
  intended item (CursorHoldsItemID) before EquipCursorItem, aborting only
  on a definitive mismatch so empty/unknown cursors behave as before.
- NampowerAPI.lua / Utility.lua: replace GetContainerItemLink /
  GetInventoryItemLink + "item:(%d+)" parsing with direct C_Container/
  inventory ID lookups at the sites that only need the itemID; route the
  equipped-set scans through the GetEquippedItemID helper.
- Conditionals.lua / Utility.lua: replace the 785-entry CCSpellMechanics
  fallback table with C_Spell.GetSpellMechanicByID in GetSpellMechanic and
  GetSpellCCType (BuffLib / nampower paths unchanged); delete the table.
This commit is contained in:
Brues
2026-06-21 14:02:49 -05:00
parent d435d90871
commit f21f90d0f1
5 changed files with 156 additions and 280 deletions
+13
View File
@@ -3721,6 +3721,19 @@ function CleveRoids.EquipBagItem(msg, slotOrOffhand)
return false
end
-- Verify the cursor holds the item we meant to pick up. The bag can shift
-- between the lookup and the pickup (item consumed/moved/reorganized), in
-- which case we'd otherwise equip whatever landed on the cursor. Only abort
-- on a definitive mismatch (false); nil = can't tell -> trust CursorHasItem.
if item.id and CleveRoids.ClassicAPI.CursorHoldsItemID(item.id) == false then
if CleveRoids.equipDebugLog then
CleveRoids.Print("|cffff8800[EquipLog] Cursor holds wrong item after pickup; aborting equip|r")
end
ClearCursor()
CleveRoids.equipInProgress = false
return false
end
EquipCursorItem(invslot)
ClearCursor()