mirror of
https://github.com/godotengine/godot.git
synced 2024-11-27 09:16:35 +08:00
Fix listing files inside directory in pack file
When adding a directory path to the inventory of the pack, an empty file name was being added to the file list. That made `Directory.get_ntext()` signal end-of-list too early so that files in a subdirectory were missed. Fixes #15801. Helps with #16798.
This commit is contained in:
parent
201d2d7226
commit
536611704a
@ -88,7 +88,11 @@ void PackedData::add_path(const String &pkg_path, const String &path, uint64_t o
|
||||
}
|
||||
}
|
||||
}
|
||||
cd->files.insert(path.get_file());
|
||||
String filename = path.get_file();
|
||||
// Don't add as a file if the path points to a directoryy
|
||||
if (!filename.empty()) {
|
||||
cd->files.insert(filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user