diff options
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/node.cpp | 24 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 17 |
2 files changed, 14 insertions, 27 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index caa0da5d1f..1f0ccffab2 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -408,7 +408,6 @@ void Node::set_physics_process(bool p_process) { else remove_from_group("physics_process"); - data.physics_process = p_process; _change_notify("physics_process"); } @@ -429,7 +428,6 @@ void Node::set_physics_process_internal(bool p_process_internal) { else remove_from_group("physics_process_internal"); - data.physics_process_internal = p_process_internal; _change_notify("physics_process_internal"); } @@ -811,7 +809,6 @@ void Node::set_process(bool p_idle_process) { else remove_from_group("idle_process"); - data.idle_process = p_idle_process; _change_notify("idle_process"); } @@ -832,7 +829,6 @@ void Node::set_process_internal(bool p_idle_process_internal) { else remove_from_group("idle_process_internal"); - data.idle_process_internal = p_idle_process_internal; _change_notify("idle_process_internal"); } @@ -1021,7 +1017,7 @@ void Node::_validate_child_name(Node *p_child, bool p_force_human_readable) { if (!unique) { - node_hrcr_count.ref(); + ERR_FAIL_COND(!node_hrcr_count.ref()); String name = "@" + String(p_child->get_name()) + "@" + itos(node_hrcr_count.get()); p_child->data.name = name; } @@ -1269,6 +1265,7 @@ void Node::remove_child(Node *p_child) { } } + ERR_EXPLAIN("Cannot remove child node " + p_child->to_string() + " as it is not in our list of children"); ERR_FAIL_COND(idx == -1); //ERR_FAIL_COND( p_child->data.blocked > 0 ); @@ -2198,8 +2195,11 @@ void Node::_duplicate_and_reown(Node *p_new_parent, const Map<Node *, Node *> &p ERR_EXPLAIN("Node: Could not duplicate: " + String(get_class())); ERR_FAIL_COND(!obj); node = Object::cast_to<Node>(obj); - if (!node) + if (!node) { memdelete(obj); + ERR_EXPLAIN("Node: Could not duplicate: " + String(get_class())); + ERR_FAIL(); + } } List<PropertyInfo> plist; @@ -2295,16 +2295,16 @@ Node *Node::duplicate_and_reown(const Map<Node *, Node *> &p_reown_map) const { ERR_FAIL_COND_V(get_filename() != "", NULL); - Node *node = NULL; - Object *obj = ClassDB::instance(get_class()); ERR_EXPLAIN("Node: Could not duplicate: " + String(get_class())); ERR_FAIL_COND_V(!obj, NULL); - node = Object::cast_to<Node>(obj); - if (!node) - memdelete(obj); - ERR_FAIL_COND_V(!node, NULL); + Node *node = Object::cast_to<Node>(obj); + if (!node) { + memdelete(obj); + ERR_EXPLAIN("Node: Could not duplicate: " + String(get_class())); + ERR_FAIL_V(NULL); + } node->set_name(get_name()); List<PropertyInfo> plist; diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index dbf3150ae0..2668acd3d5 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -37,7 +37,6 @@ #include "core/os/os.h" #include "core/print_string.h" #include "core/project_settings.h" -#include "editor/editor_node.h" #include "main/input_default.h" #include "node.h" #include "scene/resources/dynamic_font.h" @@ -647,7 +646,8 @@ void SceneTree::_notification(int p_notification) { case NOTIFICATION_WM_MOUSE_ENTER: case NOTIFICATION_WM_MOUSE_EXIT: case NOTIFICATION_WM_FOCUS_IN: - case NOTIFICATION_WM_FOCUS_OUT: { + case NOTIFICATION_WM_FOCUS_OUT: + case NOTIFICATION_WM_ABOUT: { if (p_notification == NOTIFICATION_WM_FOCUS_IN) { InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton()); @@ -671,19 +671,6 @@ void SceneTree::_notification(int p_notification) { } break; - case NOTIFICATION_WM_ABOUT: { - -#ifdef TOOLS_ENABLED - if (EditorNode::get_singleton()) { - EditorNode::get_singleton()->show_about(); - } else { -#endif - get_root()->propagate_notification(p_notification); -#ifdef TOOLS_ENABLED - } -#endif - } break; - case NOTIFICATION_CRASH: { get_root()->propagate_notification(p_notification); |