Replace equipment cache with C_Item.IsEquippedItem

HasGearEquipped now wraps ClassicAPI's native slot-walk, which
short-circuits on first match. Removes BuildEquipmentCache, the
_equipped* cache tables/invalidation, and the InvalidateEquipmentCache
call from PLAYER_EQUIPMENT_CHANGED. [equipped] reads live engine state,
so no cache staleness surface remains; also gains item-link support.
This commit is contained in:
Brues
2026-07-30 20:35:39 -05:00
parent 8d86389a03
commit fcd206756d
2 changed files with 8 additions and 123 deletions
+3 -8
View File
@@ -5724,14 +5724,9 @@ function CleveRoids.Frame:PLAYER_EQUIPMENT_CHANGED()
-- arg1 = inventory slot that changed, arg2 = hasCurrent (slot now holds an item)
local slot, hasCurrent = arg1, arg2
-- [equipped]/HasGearEquipped runs off its own live-rebuilt cache; invalidating
-- it is all that conditional needs.
if CleveRoids.InvalidateEquipmentCache then
CleveRoids.InvalidateEquipmentCache()
end
-- In combat: Skip indexing - EquipBagItem already handles cache invalidation
-- at the call site. This eliminates lag during rapid gear swapping.
-- In combat: skip the slot reindex to avoid lag during rapid gear swapping.
-- [equipped] reads live engine state (C_Item.IsEquippedItem) so it stays
-- correct regardless; the Items table self-heals on the next BAG_UPDATE.
if UnitAffectingCombat("player") then
return
end