From 28a181e2d461b3b9b9ac69de13778f14e5cdf83d Mon Sep 17 00:00:00 2001 From: shylie Date: Thu, 18 Jul 2024 11:45:31 -0400 Subject: [PATCH] Fix incorrect error message; Fix selector Node --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)