Fix uninitialized integers

This commit is contained in:
Serhii Snitsaruk 2024-08-03 13:48:15 +02:00
parent 9abfe4ce95
commit 68a9492f3d
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
5 changed files with 6 additions and 5 deletions

View File

@ -18,7 +18,7 @@ class BTInstance : public RefCounted {
private: private:
Ref<BTTask> root_task; Ref<BTTask> root_task;
uint64_t owner_node_id; uint64_t owner_node_id = 0;
String source_bt_path; String source_bt_path;
BT::Status last_status = BT::FRESH; BT::Status last_status = BT::FRESH;
@ -39,7 +39,7 @@ protected:
public: public:
_FORCE_INLINE_ Ref<BTTask> get_root_task() const { return root_task; } _FORCE_INLINE_ Ref<BTTask> get_root_task() const { return root_task; }
_FORCE_INLINE_ Node *get_owner_node() const { return Object::cast_to<Node>(OBJECT_DB_GET_INSTANCE(owner_node_id)); } _FORCE_INLINE_ Node *get_owner_node() const { return owner_node_id ? Object::cast_to<Node>(OBJECT_DB_GET_INSTANCE(owner_node_id)) : nullptr; }
_FORCE_INLINE_ BT::Status get_last_status() const { return last_status; } _FORCE_INLINE_ BT::Status get_last_status() const { return last_status; }
_FORCE_INLINE_ bool is_instance_valid() const { return root_task.is_valid(); } _FORCE_INLINE_ bool is_instance_valid() const { return root_task.is_valid(); }
_FORCE_INLINE_ String get_source_bt_path() const { return source_bt_path; } _FORCE_INLINE_ String get_source_bt_path() const { return source_bt_path; }

View File

@ -47,7 +47,7 @@ public:
}; };
List<TaskData> tasks; List<TaskData> tasks;
uint64_t bt_instance_id; uint64_t bt_instance_id = 0;
NodePath node_owner_path; NodePath node_owner_path;
String source_bt_path; String source_bt_path;

View File

@ -132,6 +132,7 @@ bool LimboDebugger::is_active() const {
} }
void LimboDebugger::_track_tree(uint64_t p_instance_id) { void LimboDebugger::_track_tree(uint64_t p_instance_id) {
ERR_FAIL_COND(p_instance_id == 0);
ERR_FAIL_COND(!active_bt_instances.has(p_instance_id)); ERR_FAIL_COND(!active_bt_instances.has(p_instance_id));
_untrack_tree(); _untrack_tree();

View File

@ -49,7 +49,7 @@ protected:
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
private: private:
HashSet<uint64_t> active_bt_instances; HashSet<uint64_t> active_bt_instances;
uint64_t tracked_instance_id; uint64_t tracked_instance_id = 0;
bool session_active = false; bool session_active = false;
void _track_tree(uint64_t p_instance_id); void _track_tree(uint64_t p_instance_id);

View File

@ -52,7 +52,7 @@ class LimboDebuggerTab : public PanelContainer {
private: private:
struct BTInstanceInfo { struct BTInstanceInfo {
uint64_t instance_id; uint64_t instance_id = 0;
String owner_node_path; String owner_node_path;
}; };