mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-25 21:03:15 -04:00
Resolved crashes due to incorrect music state - no idea what's actually causing it, but the entire music track handling needs a revamp anyway
This commit is contained in:
parent
6b1031dae5
commit
59bd7d200b
@ -109,8 +109,9 @@ internal class MusicTrackController(private var volume: Float, initialFadeVolume
|
|||||||
* @throws IllegalStateException if called on uninitialized instance
|
* @throws IllegalStateException if called on uninitialized instance
|
||||||
*/
|
*/
|
||||||
fun play(): Boolean {
|
fun play(): Boolean {
|
||||||
check(state.canPlay && music != null) {
|
if (!state.canPlay || music == null) {
|
||||||
"MusicTrackController.play called on uninitialized instance"
|
clear() // reset to correct state
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unexplained observed exception: Gdx.Music.play fails with
|
// Unexplained observed exception: Gdx.Music.play fails with
|
||||||
|
Loading…
x
Reference in New Issue
Block a user