From 1bd5965ba1abf0ae598ef7dd85d2655e408db53e Mon Sep 17 00:00:00 2001 From: xtex Date: Sun, 30 Jul 2023 10:40:32 +0800 Subject: [PATCH] fix: crash on fast-forwarded music player --- common/src/main/kotlin/quaedam/projection/music/MusicPlayer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/quaedam/projection/music/MusicPlayer.kt b/common/src/main/kotlin/quaedam/projection/music/MusicPlayer.kt index e464759..c6ed339 100644 --- a/common/src/main/kotlin/quaedam/projection/music/MusicPlayer.kt +++ b/common/src/main/kotlin/quaedam/projection/music/MusicPlayer.kt @@ -43,7 +43,7 @@ class MusicPlayer(val seed: Long, val level: Level, val pos: BlockPos, val start init { val currentRemaining = totalTime - (level.gameTime - startedAt) - while (remainingTime > currentRemaining) { + while (remainingTime > currentRemaining && !isEnd) { // seek to current position remainingTime -= fetchNote().time }