Skip to content

Commit

Permalink
Allow action.X.usable == nil to still be treated as usable in state:I…
Browse files Browse the repository at this point in the history
…sUsable().
  • Loading branch information
Hekili committed Dec 2, 2021
1 parent 9d26897 commit 959d7da
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions State.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6396,11 +6396,15 @@ do
if not ability then return true end

local hook, reason = ns.callHook( "IsUsable", spell )
if hook == false then return false, reason end
if hook == false then
return false, reason
end

if ability.funcs.usable then
local usable, reason = ability.funcs.usable( self, ability )
if not usable then return false, reason end
if usable == false then -- Have allowed nil return values for usable to be treated as usable before.
return false, reason
end
else
local usable = ability.usable
if type( usable ) == "number" and not IsUsableSpell( usable ) then
Expand Down

0 comments on commit 959d7da

Please sign in to comment.