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
|
if Nodes[name] then
|
||||||
error('node with name \'' .. name .. '\' already exists.', 2)
|
error('node with name \'' .. name .. '\' already exists.', 2)
|
||||||
else
|
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] })
|
Nodes[name] = setmetatable({}, { __index = Nodes[parent_type_name] })
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ Tactree.Leaf 'Selector'
|
|||||||
local result
|
local result
|
||||||
repeat
|
repeat
|
||||||
result = node.children[node:private().current_child]:update(...)
|
result = node.children[node:private().current_child]:update(...)
|
||||||
if result then
|
if result == false then
|
||||||
node:private().current_child = node:private().current_child + 1
|
node:private().current_child = node:private().current_child + 1
|
||||||
end
|
end
|
||||||
until (result ~= false) or (node:private().current_child > #node.children)
|
until (result ~= false) or (node:private().current_child > #node.children)
|
||||||
|
Loading…
Reference in New Issue
Block a user