diff --git a/bt/bt_state.cpp b/bt/bt_state.cpp index 8238d93..b03f6f2 100644 --- a/bt/bt_state.cpp +++ b/bt/bt_state.cpp @@ -38,7 +38,9 @@ void BTState::_update(double p_delta) { void BTState::_notification(int p_notification) { switch (p_notification) { case NOTIFICATION_EXIT_TREE: { - LimboDebugger::get_singleton()->unregister_bt_instance(tree_instance, get_path()); + if (tree_instance.is_valid()) { + LimboDebugger::get_singleton()->unregister_bt_instance(tree_instance, get_path()); + } } break; } } diff --git a/debugger/limbo_debugger.cpp b/debugger/limbo_debugger.cpp index d833046..f9d9fe0 100644 --- a/debugger/limbo_debugger.cpp +++ b/debugger/limbo_debugger.cpp @@ -57,23 +57,23 @@ Error LimboDebugger::parse_message(void *p_user, const String &p_msg, const Arra return OK; } -void LimboDebugger::register_bt_instance(Ref p_instance, NodePath p_path) { - ERR_FAIL_COND(active_trees.has(p_path)); +void LimboDebugger::register_bt_instance(Ref p_instance, NodePath p_player_path) { + ERR_FAIL_COND(active_trees.has(p_player_path)); - active_trees.insert(p_path, p_instance); + active_trees.insert(p_player_path, p_instance); if (session_active) { _send_active_bt_players(); } } -void LimboDebugger::unregister_bt_instance(Ref p_instance, NodePath p_path) { - ERR_FAIL_COND(p_path.is_empty()); - ERR_FAIL_COND(!active_trees.has(p_path)); +void LimboDebugger::unregister_bt_instance(Ref p_instance, NodePath p_player_path) { + ERR_FAIL_COND(p_player_path.is_empty()); + ERR_FAIL_COND(!active_trees.has(p_player_path)); - if (tracked_tree == p_path) { + if (tracked_tree == p_player_path) { _untrack_tree(); } - active_trees.erase(p_path); + active_trees.erase(p_player_path); if (session_active) { _send_active_bt_players(); diff --git a/debugger/limbo_debugger.h b/debugger/limbo_debugger.h index 1c2e09c..4d77db8 100644 --- a/debugger/limbo_debugger.h +++ b/debugger/limbo_debugger.h @@ -39,9 +39,9 @@ private: public: static Error parse_message(void *p_user, const String &p_msg, const Array &p_args, bool &r_captured); - void register_bt_instance(Ref p_instance, NodePath p_path); + void register_bt_instance(Ref p_instance, NodePath p_player_path); + void unregister_bt_instance(Ref p_instance, NodePath p_player_path); - void unregister_bt_instance(Ref p_instance, NodePath p_path); #endif // DEBUG_ENABLED }; #endif // LIMBO_DEBUGGER \ No newline at end of file diff --git a/debugger/limbo_debugger_plugin.cpp b/debugger/limbo_debugger_plugin.cpp index 02ca56b..defe6cc 100644 --- a/debugger/limbo_debugger_plugin.cpp +++ b/debugger/limbo_debugger_plugin.cpp @@ -62,7 +62,8 @@ void LimboDebuggerTab::update_behavior_tree(const BehaviorTreeData &p_data) { void LimboDebuggerTab::_show_alert(const String &p_message) { alert_message->set_text(p_message); - alert_icon->set_texture(get_theme_icon(SNAME("NodeInfo"), SNAME("EditorIcons"))); + // alert_icon->set_texture(get_theme_icon(SNAME("NodeInfo"), SNAME("EditorIcons"))); + alert_icon->set_texture(get_theme_icon(SNAME("StatusWarning"), SNAME("EditorIcons"))); alert_box->set_visible(!p_message.is_empty()); }