Fix BTPlayer.restart() crash

This commit is contained in:
Serhii Snitsaruk 2024-07-30 12:42:22 +02:00
parent 186ee3c6a7
commit 456687c857
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
1 changed files with 1 additions and 0 deletions

View File

@ -144,6 +144,7 @@ void BTPlayer::update(double p_delta) {
} }
void BTPlayer::restart() { 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(); tree_instance->abort();
set_active(true); set_active(true);
} }