mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Support #showtooltip spell:<id> and item:<id>
GetSpell/GetItem now resolve explicit spell:/item: ID forms. spell:<id> prefers the player's spellbook entry via FindSpellBookSlotByID (per-rank and pet aware) for full cost/cooldown/usability, falling back to an id-only entry rendered via SetSpellByID for spells not in the book. item:<id> reuses the existing numeric lookup for location-aware tooltips. Guard the id-only path against nil spellSlot/cost in TestForActiveAction and GetActionCooldown so display-only spell references don't crash. Remove the dead, no-op GetSpellSlotByID stub.
This commit is contained in:
@@ -970,7 +970,10 @@ function CleveRoids.TestForActiveAction(actions)
|
||||
actions.active.oom = (manaToCheck < actions.active.spell.cost)
|
||||
end
|
||||
|
||||
local start, duration = GetSpellCooldown(actions.active.spell.spellSlot, actions.active.spell.bookType)
|
||||
local start, duration = 0, 0
|
||||
if actions.active.spell.spellSlot then
|
||||
start, duration = GetSpellCooldown(actions.active.spell.spellSlot, actions.active.spell.bookType)
|
||||
end
|
||||
local onCooldown = (start > 0 and duration > 0)
|
||||
|
||||
if actions.active.isReactive then
|
||||
@@ -4626,7 +4629,7 @@ function GetActionCooldown(slot)
|
||||
return GetInventoryItemCooldown("player", slotId)
|
||||
end
|
||||
|
||||
if a.spell then
|
||||
if a.spell and a.spell.spellSlot then
|
||||
return GetSpellCooldown(a.spell.spellSlot, a.spell.bookType)
|
||||
elseif a.item then
|
||||
if a.item.bagID and a.item.slot then
|
||||
|
||||
Reference in New Issue
Block a user