Fix incorrect error message; Fix selector Node
This commit is contained in:
parent
ebe76a64ce
commit
28a181e2d4
4
init.lua
4
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)
|
||||
|
Loading…
Reference in New Issue
Block a user