From 4207fbf8f319fc0543c79c24c4bf90da7c1958ba Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Sun, 21 Apr 2024 16:08:37 +0200 Subject: [PATCH] Fix `LimboState::get_root` freezes the process --- hsm/limbo_state.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hsm/limbo_state.cpp b/hsm/limbo_state.cpp index 62e451d..77554bb 100644 --- a/hsm/limbo_state.cpp +++ b/hsm/limbo_state.cpp @@ -29,11 +29,11 @@ void LimboState::_update_blackboard_plan() { } LimboState *LimboState::get_root() const { - const LimboState *state = this; + const Node *state = this; while (state->get_parent() && IS_CLASS(state->get_parent(), LimboState)) { - state = Object::cast_to(get_parent()); + state = state->get_parent(); } - return const_cast(state); + return const_cast(Object::cast_to(state)); } LimboState *LimboState::named(const String &p_name) {