2
0
Эх сурвалжийг харах

Fix `EditorFileSystemDirectory::get_file_deps()` may return wrong results

Limit the maxsplit to `8` to get complete `deps`.

`deps` caches the return value of `ResourceLoader::get_dependencies()`,
which is also separated by "::".
"::" is quite popular as a splitter.
风青山 2 жил өмнө
parent
commit
203f3e700b

+ 2 - 1
editor/editor_file_system.cpp

@@ -261,7 +261,8 @@ void EditorFileSystem::_scan_filesystem() {
 					cpath = name;
 					cpath = name;
 
 
 				} else {
 				} else {
-					Vector<String> split = l.split("::");
+					// The last section (deps) may contain the same splitter, so limit the maxsplit to 8 to get the complete deps.
+					Vector<String> split = l.split("::", true, 8);
 					ERR_CONTINUE(split.size() < 9);
 					ERR_CONTINUE(split.size() < 9);
 					String name = split[0];
 					String name = split[0];
 					String file;
 					String file;