diff options
-rw-r--r-- | editor/editor_log.cpp | 4 | ||||
-rw-r--r-- | scene/3d/collision_object_3d.cpp | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp index 469fb41406..622b3fe355 100644 --- a/editor/editor_log.cpp +++ b/editor/editor_log.cpp @@ -234,7 +234,9 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) { if (p_replace_previous) { // Remove last line if replacing, as it will be replace by the next added line. - log->remove_line(log->get_line_count() - 1); + // Why - 2? RichTextLabel is weird. When you add a line, it also adds a NEW line, which is null, + // but it still counts as a line. So if you remove the last line (count - 1) you are actually removing nothing... + log->remove_line(log->get_line_count() - 2); log->increment_line_count(); } diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index 914b3ad816..cba769a8f8 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -215,6 +215,11 @@ void CollisionObject3D::_shape_changed(const Ref<Shape3D> &p_shape) { } void CollisionObject3D::_update_debug_shapes() { + if (!is_inside_tree()) { + debug_shapes_to_update.clear(); + return; + } + for (Set<uint32_t>::Element *shapedata_idx = debug_shapes_to_update.front(); shapedata_idx; shapedata_idx = shapedata_idx->next()) { if (shapes.has(shapedata_idx->get())) { ShapeData &shapedata = shapes[shapedata_idx->get()]; |