worlds list is sorted now

This commit is contained in:
MihailRis 2024-02-04 06:03:31 +03:00
parent 86412a28ec
commit 6ae59cd851

View File

@ -65,6 +65,11 @@ std::vector<fs::path> EnginePaths::scanForWorlds() {
}
folders.push_back(worldFolder);
}
std::sort(folders.begin(), folders.end(), [](fs::path a, fs::path b) {
a = a/fs::u8path(WorldFiles::WORLD_FILE);
b = b/fs::u8path(WorldFiles::WORLD_FILE);
return fs::last_write_time(a) > fs::last_write_time(b);
});
return folders;
}