Merge pull request #21540 from YeldhamDev/image_reimp_error_fix

Fix error when reimporting an Image resource
This commit is contained in:
Rémi Verschelde 2018-09-13 14:09:39 +02:00 committed by GitHub
commit bcc50de2d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1479,13 +1479,17 @@ void EditorFileSystem::_reimport_file(const String &p_file) {
cf.instance(); cf.instance();
Error err = cf->load(p_file + ".import"); Error err = cf->load(p_file + ".import");
if (err == OK) { if (err == OK) {
if (cf->has_section("params")) {
List<String> sk; List<String> sk;
cf->get_section_keys("params", &sk); cf->get_section_keys("params", &sk);
for (List<String>::Element *E = sk.front(); E; E = E->next()) { for (List<String>::Element *E = sk.front(); E; E = E->next()) {
params[E->get()] = cf->get_value("params", E->get()); params[E->get()] = cf->get_value("params", E->get());
} }
}
if (cf->has_section("remap")) {
importer_name = cf->get_value("remap", "importer"); importer_name = cf->get_value("remap", "importer");
} }
}
} else { } else {
late_added_files.insert(p_file); //imported files do not call update_file(), but just in case.. late_added_files.insert(p_file); //imported files do not call update_file(), but just in case..