summaryrefslogtreecommitdiffstats
path: root/core/io/resource_import.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-07-19 17:00:46 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-07-19 17:06:03 -0300
commit25678b1876816b9ccb14b2c92aef62f3b009f88f (patch)
tree189f082d788f78e16f620b056d21249118883fc5 /core/io/resource_import.cpp
parent89588d43349e496a9e05756d42ae87323d31269e (diff)
downloadredot-engine-25678b1876816b9ccb14b2c92aef62f3b009f88f.tar.gz
-Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
Diffstat (limited to 'core/io/resource_import.cpp')
-rw-r--r--core/io/resource_import.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/io/resource_import.cpp b/core/io/resource_import.cpp
index ffb27bc26a..61da4f3350 100644
--- a/core/io/resource_import.cpp
+++ b/core/io/resource_import.cpp
@@ -49,6 +49,7 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
int lines = 0;
String error_text;
+ bool path_found = false; //first match must have priority
while (true) {
assign = Variant();
@@ -66,14 +67,16 @@ Error ResourceFormatImporter::_get_path_and_type(const String &p_path, PathAndTy
}
if (assign != String()) {
- if (assign.begins_with("path.") && r_path_and_type.path == String()) {
+ if (!path_found && assign.begins_with("path.") && r_path_and_type.path == String()) {
String feature = assign.get_slicec('.', 1);
if (OS::get_singleton()->check_feature_support(feature)) {
r_path_and_type.path = value;
+ path_found = true; //first match must have priority
}
- } else if (assign == "path") {
+ } else if (!path_found && assign == "path") {
r_path_and_type.path = value;
+ path_found = true; //first match must have priority
} else if (assign == "type") {
r_path_and_type.type = value;
}