From f3da335416fb8b04cbd3c487345789537acba2d4 Mon Sep 17 00:00:00 2001 From: Sergey Minakov Date: Tue, 13 Jul 2021 21:30:19 +0300 Subject: [PATCH] [iOS] Fix plugin configuration loading Clear ConfigFile parameter before loading new file. Ignore duplicate input plist keys (cherry picked from commit aa321f0a244fd0a8c072806a12203b8de9b50135) --- platform/iphone/export/export.cpp | 7 ++++++- platform/iphone/plugin/godot_plugin_config.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index a73c69381bd..d8ce55ac516 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -372,6 +372,8 @@ void EditorExportPlatformIOS::get_export_options(List *r_options) r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "plugins/" + found_plugins[i].name), false)); } + Set plist_keys; + for (int i = 0; i < found_plugins.size(); i++) { // Editable plugin plist values PluginConfigIOS plugin = found_plugins[i]; @@ -383,7 +385,10 @@ void EditorExportPlatformIOS::get_export_options(List *r_options) switch (item.type) { case PluginConfigIOS::PlistItemType::STRING_INPUT: { String preset_name = "plugins_plist/" + key; - r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, preset_name), item.value)); + if (!plist_keys.has(preset_name)) { + r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, preset_name), item.value)); + plist_keys.insert(preset_name); + } } break; default: continue; diff --git a/platform/iphone/plugin/godot_plugin_config.h b/platform/iphone/plugin/godot_plugin_config.h index 66b4d391310..2edd2bb553e 100644 --- a/platform/iphone/plugin/godot_plugin_config.h +++ b/platform/iphone/plugin/godot_plugin_config.h @@ -270,6 +270,8 @@ static inline PluginConfigIOS load_plugin_config(Ref config_file, co return plugin_config; } + config_file->clear(); + Error err = config_file->load(path); if (err != OK) {