From 326217dc0f395d049d1fc72ea58a83f245993c1e Mon Sep 17 00:00:00 2001 From: Anish Kumar Date: Mon, 15 Dec 2025 17:39:49 +0530 Subject: [PATCH] Fix editor settings parsing regression on Android --- scene/resources/resource_format_text.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index b4791deeb0..9861e075df 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -419,18 +419,17 @@ Ref ResourceLoaderText::_parse_node_tag(VariantParser::ResourcePars } void ResourceLoaderText::_count_resources() { + Ref scan_f = FileAccess::open(f->get_path(), FileAccess::READ); + if (scan_f.is_null()) { + return; + } + resources_total = 0; resource_current = 0; - // Save current file position to restore after counting. - uint64_t original_pos = f->get_position(); - - // Seek to beginning to count all resources. - f->seek(0); - bool has_main_resource = false; - while (!f->eof_reached()) { - String line = f->get_line().strip_edges(); + while (!scan_f->eof_reached()) { + String line = scan_f->get_line().strip_edges(); // Only count resources that contribute to progress // (ext_resources are loaded asynchronously and don't count). @@ -446,9 +445,6 @@ void ResourceLoaderText::_count_resources() { } } } - - // Restore original file position. - f->seek(original_pos); } Error ResourceLoaderText::load() {