From 4e2dbf7eeb414a9e905efd896f549ddd1046f92e Mon Sep 17 00:00:00 2001 From: niwho Date: Wed, 11 May 2022 16:28:43 +0800 Subject: [PATCH] fix random node getting weight from params --- BehaviorTree3.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BehaviorTree3.lua b/BehaviorTree3.lua index 43d1926..52a2df7 100644 --- a/BehaviorTree3.lua +++ b/BehaviorTree3.lua @@ -385,10 +385,10 @@ local function ProcessNode(node, nodes) local randomNode = addNode("random") randomNode.indices = {} for _,childNode in pairs(node.params.nodes) do - if childNode.weight then + if childNode.params.weight then local base = #randomNode.indices local index = #nodes + 1 - for i = 1, childNode.weight do + for i = 1, childNode.params.weight do randomNode.indices[base + i] = index end else