diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-07-17 23:44:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-17 23:44:16 +0200 |
commit | e6cf0d444b37522ab1e637dd173e8c7199bf36d7 (patch) | |
tree | aef6a5a64bd0c3cce26cef76b4c22c44cb29a191 /tools/editor/editor_node.cpp | |
parent | 7b28976af5c4c1bb7bf49028d7e9fde5465d7d2e (diff) | |
parent | 7767aa272262d2fdfdb5b8ae50cb3470e993ce74 (diff) |
Merge pull request #5758 from TheHX/issue-5756
Fix editor states saving, and remove related error messages
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r-- | tools/editor/editor_node.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 92b22eb5d1..dee521beb3 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -704,7 +704,7 @@ void EditorNode::_get_scene_metadata(const String& p_file) { cf.instance(); Error err = cf->load(path); - if (err!=OK) + if (err!=OK || !cf->has_section("editor_states")) return; //must not exist List<String> esl; @@ -740,7 +740,14 @@ void EditorNode::_set_scene_metadata(const String& p_file, int p_idx) { Ref<ConfigFile> cf; cf.instance(); - Dictionary md = editor_data.get_edited_scene()==p_idx?editor_data.get_editor_states():editor_data.get_scene_editor_states(p_idx); + Dictionary md; + + if (p_idx<0 || editor_data.get_edited_scene()==p_idx) { + md = editor_data.get_editor_states(); + } else { + md = editor_data.get_scene_editor_states(p_idx); + } + List<Variant> keys; md.get_key_list(&keys); |