mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-15 23:50:38 +00:00
IsUsableSpell hand-rolled five checks (known, alive, off cooldown, power, reagents) and diverged from IsUsableAction exactly where the engine does more or less: it never tested stance, so Whirlwind in Battle Stance reported usable, and it tested cooldown first, so a 0-rage Whirlwind on cooldown reported (nil, nil) instead of (nil, 1). IsUsableAction reads a per-slot cache that FUN_004E5050 fills by calling FUN_SPELL_IS_USABLE (0x006E3D60) on a player spell's record, or by comparing the pet's power against the spell cost for a pet spell. Run those same two paths live, plus the knowledge gate the helper lacks. Cooldown is not part of usability: the helper has no cooldown branch and FrameXML greys and swipes as separate states. Item::Usable had been calling the helper all along. A pet-book spell given by ID now takes the pet path instead of always reporting not usable. Offsets.h: add VAR_PET_GUID and FUN_PET_ACTIONS_USABLE (verified via Script_HasPetUI, Script_GetPetActionsUsable and the recompute's pet branch); replace the FUN_SPELL_IS_USABLE comment with the decompiled check list. Fixes #51