mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user