From 01ae6a46de006ac0d93e0c18a8da3b2941e8e26f 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 838baf7..2c66cd7 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); }