diff --git a/lib/animation_node.lua b/lib/animation_node.lua index 3b0be94..25b3e19 100644 --- a/lib/animation_node.lua +++ b/lib/animation_node.lua @@ -30,11 +30,13 @@ function animation:chain(children) return self end ---- @param data {[1]: animationRunner, onEnd?: voidCallback, children?: AnimationNode[]} +--- @param data {[1]: animationRunner?, onEnd?: voidCallback, children?: AnimationNode[]} --- @return AnimationNode local function new(data) local t = setmetatable({}, animation) - t.run = data[1] + t.run = data[1] or function(self) + self:finish() + end t.onEnd = data.onEnd t.count = 1 -- своя анимация t.children = {} diff --git a/lib/spellbook.lua b/lib/spellbook.lua index 6d33b39..2b2e373 100644 --- a/lib/spellbook.lua +++ b/lib/spellbook.lua @@ -115,9 +115,6 @@ function attack:cast(caster, target) if not sprite or not targetSprite then return true end AnimationNode { - function(node) - caster:has(Tree.behaviors.residentsleeper):sleep(0, node) - end, onEnd = function() caster:has(Tree.behaviors.spellcaster):endCast() end, children = { AnimationNode {