Merge pull request 'Bug Fix on APL traits' (#18) from LyLoLoq/Bastion:main into main

Reviewed-on: Bastion/Bastion#18
pull/1/head
4n0n 1 year ago
commit ede085dd13
  1. 6
      src/APL/APL.lua
  2. 8
      src/Spell/Spell.lua

@ -231,7 +231,7 @@ end
-- Add an item to the APL -- Add an item to the APL
---@param item Item ---@param item Item
---@param condition fun(...):boolean ---@param condition? fun(...):boolean
---@return APLActor ---@return APLActor
function APL:AddItem(item, condition) function APL:AddItem(item, condition)
local usableFunc = item.UsableIfFunc local usableFunc = item.UsableIfFunc
@ -268,8 +268,8 @@ end
-- Execute the APL -- Execute the APL
function APL:Execute() function APL:Execute()
for _, actor in ipairs(self.apl) do for _, actor in ipairs(self.apl) do
if actor:HasTraits() and actor:Evaluate() then if actor:HasTraits() then
if actor:Execute() then if actor:Evaluate() and actor:Execute() then
break break
end end
else else

@ -161,7 +161,7 @@ end
-- Cast the spell -- Cast the spell
---@param unit Unit ---@param unit Unit
---@param condition string|function ---@param condition? string|function
---@return boolean ---@return boolean
function Spell:Cast(unit, condition) function Spell:Cast(unit, condition)
if condition then if condition then
@ -317,9 +317,9 @@ function Spell:GetWasLooking()
end end
-- Click the spell -- Click the spell
---@param x number ---@param x number|Vector3
---@param y number ---@param y? number
---@param z number ---@param z? number
---@return boolean ---@return boolean
function Spell:Click(x, y, z) function Spell:Click(x, y, z)
if type(x) == 'table' then if type(x) == 'table' then

Loading…
Cancel
Save