Skip to content

Commit

Permalink
Fix music not resuming
Browse files Browse the repository at this point in the history
  • Loading branch information
TollyH committed Dec 2, 2022
1 parent 7ea7979 commit 413342f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CSMaze/MazeGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ void FireGun()
Point? monsterCoords;
if (levels[currentLevel].Killed)
{
if (SDL_mixer.Mix_PlayingMusic() != 0)
if (SDL_mixer.Mix_PlayingMusic() != 0 && SDL_mixer.Mix_PausedMusic() == 0)
{
SDL_mixer.Mix_PauseMusic();
}
Expand All @@ -673,7 +673,7 @@ void FireGun()
// Currently playing
else
{
if (SDL_mixer.Mix_PlayingMusic() == 0 && !levels[currentLevel].Won && !isResetPromptShown)
if (SDL_mixer.Mix_PausedMusic() != 0 && !levels[currentLevel].Won && !isResetPromptShown)
{
SDL_mixer.Mix_ResumeMusic();
}
Expand Down Expand Up @@ -1010,7 +1010,7 @@ void FireGun()

if (levels[currentLevel].Won)
{
if (SDL_mixer.Mix_PlayingMusic() != 0)
if (SDL_mixer.Mix_PlayingMusic() != 0 && SDL_mixer.Mix_PausedMusic() == 0)
{
SDL_mixer.Mix_PauseMusic();
}
Expand Down Expand Up @@ -1043,7 +1043,7 @@ void FireGun()

if (isResetPromptShown)
{
if (SDL_mixer.Mix_PlayingMusic() != 0)
if (SDL_mixer.Mix_PlayingMusic() != 0 && SDL_mixer.Mix_PausedMusic() == 0)
{
SDL_mixer.Mix_PauseMusic();
}
Expand Down

0 comments on commit 413342f

Please sign in to comment.