mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
fix: if two savegame has identical lastmodifiedtime, file with lower number will be preferred
This commit is contained in:
@@ -29,7 +29,7 @@ import kotlin.math.roundToInt
|
|||||||
class SavegameCollection(files0: List<DiskSkimmer>) {
|
class SavegameCollection(files0: List<DiskSkimmer>) {
|
||||||
|
|
||||||
/** Sorted in reverse by the last modified time of the files, index zero being the most recent */
|
/** Sorted in reverse by the last modified time of the files, index zero being the most recent */
|
||||||
val files = files0.sortedByDescending {
|
val files = files0.sortedBy { it.diskFile.name }.sortedByDescending {
|
||||||
it.getLastModifiedTime().shl(2) or
|
it.getLastModifiedTime().shl(2) or
|
||||||
it.diskFile.extension.matches(Regex("^[abc]${'$'}")).toLong(1) or
|
it.diskFile.extension.matches(Regex("^[abc]${'$'}")).toLong(1) or
|
||||||
it.diskFile.extension.isBlank().toLong(0)
|
it.diskFile.extension.isBlank().toLong(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user