Fix BTPlayer.restart() crash
This commit is contained in:
parent
b5602169d4
commit
01ae6a46de
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue