Change Spell:Cast

add possibility to use functions as argument for condition
fix_getauradatabyaurainstanceid
LyLoLoq 1 year ago
parent 1bdf96e5ca
commit a84930cef2
  1. 10
      src/Spell/Spell.lua

@ -161,11 +161,15 @@ end
-- Cast the spell -- Cast the spell
---@param unit Unit ---@param unit Unit
---@param condition string ---@param condition string|function
---@return boolean ---@return boolean
function Spell:Cast(unit, condition) function Spell:Cast(unit, condition)
if condition and not self:EvaluateCondition(condition) then if condition then
return false if type(condition) == "string" and not self:EvaluateCondition(condition) then
return false
elseif type(condition) == "function" and not condition(self) then
return false
end
end end
if not self:Castable() then if not self:Castable() then

Loading…
Cancel
Save