Fix incorrect error message; Fix selector Node

This commit is contained in:
shylie 2024-07-18 11:45:31 -04:00
parent ebe76a64ce
commit 28a181e2d4

View File

@ -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)