diff --git a/init.lua b/init.lua index a249bb9..8b5c178 100644 --- a/init.lua +++ b/init.lua @@ -57,7 +57,7 @@ function Tactree.Composite(name) if Nodes[name] then error('node with name \'' .. name .. '\' already exists.', 2) else - if not Nodes[parent_type_name] then error('no such node \'' .. name .. '\'', 2) end + if not Nodes[parent_type_name] then error('no such node \'' .. parent_type_name .. '\'', 2) end Nodes[name] = setmetatable({}, { __index = Nodes[parent_type_name] }) end @@ -163,7 +163,7 @@ Tactree.Leaf 'Selector' local result repeat result = node.children[node:private().current_child]:update(...) - if result then + if result == false then node:private().current_child = node:private().current_child + 1 end until (result ~= false) or (node:private().current_child > #node.children)