mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
fix: stop-callback from disposed musicgovernor killing the newly queued music
This commit is contained in:
@@ -58,7 +58,7 @@ class TerrarumMusicGovernor : MusicGovernor() {
|
|||||||
|
|
||||||
|
|
||||||
private fun stopMusic() {
|
private fun stopMusic() {
|
||||||
AudioManager.stopMusic()
|
// AudioManager.stopMusic() // music will stop itself; with this line not commented, the stop-callback from the already disposed musicgovernor will stop the music queued by the new musicgovernor instance
|
||||||
state = STATE_INTERMISSION
|
state = STATE_INTERMISSION
|
||||||
intermissionAkku = 0f
|
intermissionAkku = 0f
|
||||||
intermissionLength = 30f + 30f * Math.random().toFloat() // 30s-60s
|
intermissionLength = 30f + 30f * Math.random().toFloat() // 30s-60s
|
||||||
@@ -117,6 +117,7 @@ class TerrarumMusicGovernor : MusicGovernor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun dispose() {
|
override fun dispose() {
|
||||||
|
AudioManager.stopMusic() // explicit call for fade-out when the game instance quits
|
||||||
stopMusic()
|
stopMusic()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user