diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/area_2d.cpp | 7 | ||||
-rw-r--r-- | scene/3d/area.cpp | 12 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index db22a38cec..841e2ef7d3 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -331,7 +331,10 @@ void Area2D::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame or at other legiminate point + continue; + //ERR_CONTINUE(!node); node->disconnect(SceneStringNames::get_singleton()->tree_entered, this, SceneStringNames::get_singleton()->_body_enter_tree); node->disconnect(SceneStringNames::get_singleton()->tree_exited, this, SceneStringNames::get_singleton()->_body_exit_tree); @@ -359,7 +362,7 @@ void Area2D::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - if (!node) //node may have been deleted in previous frame, this should not be an error + if (!node) //node may have been deleted in previous frame or at other legiminate point continue; //ERR_CONTINUE(!node); diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index 39a4e926b2..c62a866d8d 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -227,7 +227,11 @@ void Area::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame or at other legiminate point + continue; + //ERR_CONTINUE(!node); + if (!E->get().in_tree) continue; @@ -253,7 +257,11 @@ void Area::_clear_monitoring() { Object *obj = ObjectDB::get_instance(E->key()); Node *node = obj ? obj->cast_to<Node>() : NULL; - ERR_CONTINUE(!node); + + if (!node) //node may have been deleted in previous frame or at other legiminate point + continue; + //ERR_CONTINUE(!node); + if (!E->get().in_tree) continue; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 3a9968d126..4fb4e02148 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2352,7 +2352,7 @@ void Viewport::unhandled_input(const Ref<InputEvent> &p_event) { if (physics_object_picking && !get_tree()->input_handled) { - if (p_event->cast_to<InputEventMouseButton>() || p_event->cast_to<InputEventMouseMotion>() || p_event->cast_to<InputEventScreenDrag>() || p_event->cast_to<InputEventScreenTouch>()) { + if (Input::get_singleton()->get_mouse_mode() != Input::MOUSE_MODE_CAPTURED && (p_event->cast_to<InputEventMouseButton>() || p_event->cast_to<InputEventMouseMotion>() || p_event->cast_to<InputEventScreenDrag>() || p_event->cast_to<InputEventScreenTouch>())) { physics_picking_events.push_back(p_event); } } |