From 2e0047bb59fa5a0cd8e826e019bda78ad22d9685 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sun, 22 Sep 2024 14:49:46 +0200 Subject: [PATCH] Call both native and script's `_setup()` in BTTask Current behavior is overriding, which is not correct as it's an initializer function. --- bt/tasks/bt_task.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bt/tasks/bt_task.cpp b/bt/tasks/bt_task.cpp index bbf5fa7..7342d14 100644 --- a/bt/tasks/bt_task.cpp +++ b/bt/tasks/bt_task.cpp @@ -172,9 +172,8 @@ void BTTask::initialize(Node *p_agent, const Ref &p_blackboard, Node get_child(i)->initialize(p_agent, p_blackboard, p_scene_root); } - if (!GDVIRTUAL_CALL(_setup)) { - _setup(); - } + _setup(); + GDVIRTUAL_CALL(_setup); } Ref BTTask::clone() const {