浏览代码

Save binary ProjectSettings key length properly

(cherry picked from commit 06c0a5f9f2167a82f7091d2febad10aec7214dc0)
Haoyu Qiu 4 年之前
父节点
当前提交
95c60b76a4
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      core/project_settings.cpp

+ 2 - 4
core/project_settings.cpp

@@ -661,8 +661,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
 		file->store_32(count + 1);
 		file->store_32(count + 1);
 		//store how many properties are saved, add one for custom featuers, which must always go first
 		//store how many properties are saved, add one for custom featuers, which must always go first
 		String key = CoreStringNames::get_singleton()->_custom_features;
 		String key = CoreStringNames::get_singleton()->_custom_features;
-		file->store_32(key.length());
-		file->store_string(key);
+		file->store_pascal_string(key);
 
 
 		int len;
 		int len;
 		err = encode_variant(p_custom_features, nullptr, len, false);
 		err = encode_variant(p_custom_features, nullptr, len, false);
@@ -699,8 +698,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
 				value = get(key);
 				value = get(key);
 			}
 			}
 
 
-			file->store_32(key.length());
-			file->store_string(key);
+			file->store_pascal_string(key);
 
 
 			int len;
 			int len;
 			err = encode_variant(value, nullptr, len, true);
 			err = encode_variant(value, nullptr, len, true);