From 160601cc78d14d500095a5127d49c335b249141a Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Thu, 29 Jul 2021 18:17:49 -0700 Subject: Fix binary resource loading and saving --- core/io/resource_format_binary.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/io/resource_format_binary.cpp') diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index a3ebc32cc5..144db697fb 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -906,7 +906,7 @@ void ResourceLoaderBinary::open(FileAccess *p_f, bool p_no_resources, bool p_kee uid = ResourceUID::INVALID_ID; } - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 11; i++) { f->get_32(); //skip a few reserved fields } @@ -1209,8 +1209,8 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons fw->store_32(flags); fw->store_64(uid_data); - for (int i = 0; i < 5; i++) { - f->store_32(0); // reserved + for (int i = 0; i < 11; i++) { + fw->store_32(0); // reserved f->get_32(); } @@ -1264,7 +1264,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons if (using_uids) { ResourceUID::ID uid = ResourceSaver::get_resource_id_for_path(full_path); - f->store_64(uid); + fw->store_64(uid); } } @@ -1902,7 +1902,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path, const RES &p f->store_32(FORMAT_FLAG_NAMED_SCENE_IDS | FORMAT_FLAG_UIDS); ResourceUID::ID uid = ResourceSaver::get_resource_id_for_path(p_path, true); f->store_64(uid); - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 11; i++) { f->store_32(0); // reserved } -- cgit v1.2.3