Fix `Item:Usable` and `Spell:Castable`

main
jeffi 11 months ago
parent 2f7dae4e77
commit e35d19af3a
  1. 4
      src/Item/Item.lua
  2. 5
      src/Spell/Spell.lua

@ -366,8 +366,8 @@ function Item:Usable()
if not self:EvaluateTraits() then if not self:EvaluateTraits() then
return false return false
end end
if self:GetUsableFunction() then if self:GetUsableFunction() and not self:GetUsableFunction()(self) then
return self:GetUsableFunction()(self) return false
end end
return self:IsEquippedAndUsable() return self:IsEquippedAndUsable()

@ -421,9 +421,8 @@ function Spell:Castable()
if not self:EvaluateTraits() then if not self:EvaluateTraits() then
return false return false
end end
if self:GetCastableFunction() then if self:GetCastableFunction() and not self:GetCastableFunction()(self) then
return self:GetCastableFunction()(self) and return false
self:IsKnownAndUsable(type(self.traits.cast.override) ~= nil and self.traits.cast.override or nil)
end end
return self:IsKnownAndUsable(type(self.traits.cast.override) ~= nil and self.traits.cast.override or nil) return self:IsKnownAndUsable(type(self.traits.cast.override) ~= nil and self.traits.cast.override or nil)

Loading…
Cancel
Save