|
|
@ -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 |
|
|
|
|
|
|
|
if type(condition) == "string" and not self:EvaluateCondition(condition) then |
|
|
|
return false |
|
|
|
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 |
|
|
|