From 40ce9bfc2d0a6246fd80eae52fc51be753587229 Mon Sep 17 00:00:00 2001 From: rileylyman Date: Mon, 25 May 2020 14:25:34 -0700 Subject: [PATCH] skip extra newline in .tscn when renaming dependency --- scene/resources/resource_format_text.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 93db8b725f6..c7aa2c2ddc6 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -838,6 +838,11 @@ Error ResourceLoaderText::rename_dependencies(FileAccess *p_f, const String &p_p f->seek(tag_end); uint8_t c = f->get_8(); + if (c == '\n' && !f->eof_reached()) { + // Skip first newline character since we added one + c = f->get_8(); + } + while (!f->eof_reached()) { fw->store_8(c); c = f->get_8();