Skip to content

Commit

Permalink
🐛 Fix wrong rank sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
HatoYuze committed Jan 1, 2025
1 parent 7b53ac0 commit 36da9da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/kotlin/mirai/RestartLifeCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ object RestartLifeCommand : CompositeCommand(PluginMain, "remake") {
PluginMain.logger.error("Oops! 当 game.yml/enableGameSave 设定为 `false` 时,无法存储记录,此时无法使用 my 功能")
return@run
}
val data = GameSaveData.data.filter { it.content.userId == sender.user?.id }
val data = GameSaveData.data
.filter { it.content.userId == sender.user?.id }
.sortedBy { -it.content.score }

val messageContent = buildString {
for (i in 0..min(9, data.lastIndex)) {
Expand Down Expand Up @@ -190,7 +192,7 @@ object RestartLifeCommand : CompositeCommand(PluginMain, "remake") {
"month", "m" -> GameSaveData.timeFilter(30.days)
"all", "max", "a" -> GameSaveData.data
else -> GameSaveData.timeFilter(1.days)
}.sortedBy { it.content.score }
}.sortedBy { -it.content.score }

val messageContent = buildString {
for (i in 0..min(9, data.lastIndex)) {
Expand Down

0 comments on commit 36da9da

Please sign in to comment.