fix: crash on fast-forwarded music player

This commit is contained in:
xtex 2023-07-30 10:40:32 +08:00
parent eb772916dc
commit 1bd5965ba1
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -43,7 +43,7 @@ class MusicPlayer(val seed: Long, val level: Level, val pos: BlockPos, val start
init { init {
val currentRemaining = totalTime - (level.gameTime - startedAt) val currentRemaining = totalTime - (level.gameTime - startedAt)
while (remainingTime > currentRemaining) { while (remainingTime > currentRemaining && !isEnd) {
// seek to current position // seek to current position
remainingTime -= fetchNote().time remainingTime -= fetchNote().time
} }