From 456687c85774aeb893d455443da84aed3071fe4e Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Tue, 30 Jul 2024 12:42:22 +0200 Subject: [PATCH] Fix BTPlayer.restart() crash --- bt/bt_player.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bt/bt_player.cpp b/bt/bt_player.cpp index 3f8cc23..ad0b515 100644 --- a/bt/bt_player.cpp +++ b/bt/bt_player.cpp @@ -144,6 +144,7 @@ void BTPlayer::update(double p_delta) { } void BTPlayer::restart() { + ERR_FAIL_COND_MSG(tree_instance.is_null(), "BTPlayer: Restart failed - no valid tree instance. Make sure the BTPlayer has a valid behavior tree with a valid root task."); tree_instance->abort(); set_active(true); }