Fix battle music crashes

This commit is contained in:
JappaWakka 2024-02-25 18:52:28 +01:00
parent 50dd29d601
commit bb78bb3543
4 changed files with 12 additions and 8 deletions

View File

@ -1380,7 +1380,6 @@ nextIndex:
Next
If hasLevelUp = False Then
MusicManager.Play(SavedOverworld.Level.MusicLoop, True, 0.02F)
Core.SetScreen(New TransitionScreen(Me, SavedOverworld.OverworldScreen, New Color(255, 255, 255), False, AddressOf ChangeSavedScreen))
Else
Dim EvolvePokeList As New List(Of Integer)
@ -1397,7 +1396,6 @@ nextIndex:
Next
If EvolvePokeList.Count = 0 Then
MusicManager.Play(SavedOverworld.Level.MusicLoop, True, 0.02F)
Core.SetScreen(New TransitionScreen(Me, SavedOverworld.OverworldScreen, New Color(255, 255, 255), False, AddressOf ChangeSavedScreen))
Else
Core.SetScreen(New TransitionScreen(Me, New EvolutionScreen(Core.CurrentScreen, EvolvePokeList, "", EvolutionCondition.EvolutionTrigger.LevelUp, True), Color.Black, False))

View File

@ -227,7 +227,13 @@ Public Class MusicManager
_currentSong = Nothing
_currentSongName = "Silence"
_isIntroStarted = False
PlayNoMusic()
If Muted = True Then
Volume = 0.0F
Else
Volume = 1.0F
End If
_isFadingOut = False
Play("Silence", True, 0.0F)
End Sub
Public Shared Sub PlayNoMusic()

View File

@ -546,6 +546,7 @@
Player.Temp.BeforeBattleFacing = Screen.Camera.GetPlayerFacingDirection()
Dim b As BattleSystem.BattleScreen = CType(Me.NewScreen, BattleSystem.BattleScreen)
MusicManager.ClearCurrentlyPlaying()
If BattleSystem.BattleScreen.CustomBattleMusic = "" OrElse MusicManager.SongExists(BattleSystem.BattleScreen.CustomBattleMusic) = False Then
If b.IsPVPBattle = True Then
MusicManager.Play(MusicLoop, False, 0.0F, True, "pvp")

View File

@ -71,11 +71,6 @@
Public Overrides Sub Update()
If reduce = False Then
Dim screens() As Screen.Identifications = {Screen.Identifications.PokegearScreen, Screen.Identifications.OverworldScreen}
If screens.Contains(NewScreen.Identification) Then
MusicManager.Play(Screen.Level.MusicLoop, True, 0.01F)
End If
alpha += Speed
If OldScreen.UpdateFadeOut = True Then
OldScreen.Update()
@ -86,6 +81,10 @@
If noStuff = False Then
doSub()
End If
Dim screens() As Screen.Identifications = {Screen.Identifications.PokegearScreen, Screen.Identifications.OverworldScreen}
If screens.Contains(NewScreen.Identification) Then
MusicManager.Play(Screen.Level.MusicLoop, True, 0.02F)
End If
End If
Else
alpha -= Speed