From 758327f4b3c560ef8cf678d1040c4133f7c96f58 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 5 Mar 2010 03:11:10 +0000 Subject: [PATCH] - Fixed: snd_musicvolume needs to check GSnd for NULL, since somebody might have set an atexit for it, which gets executed after the sound system shuts down. - Fixed: FPlayList::Backup() failed to wrap around below entry 0 because Position is unsigned now. SVN r2188 (trunk) --- src/s_playlist.cpp | 2 +- src/sound/i_music.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/s_playlist.cpp b/src/s_playlist.cpp index 1ab294dc1..e92a5ceea 100644 --- a/src/s_playlist.cpp +++ b/src/s_playlist.cpp @@ -198,7 +198,7 @@ int FPlayList::Advance () int FPlayList::Backup () { - if (--Position < 0) + if (Position-- == 0) { Position = Songs.Size() - 1; } diff --git a/src/sound/i_music.cpp b/src/sound/i_music.cpp index 83c75410d..38e820c8b 100644 --- a/src/sound/i_music.cpp +++ b/src/sound/i_music.cpp @@ -112,7 +112,10 @@ CUSTOM_CVAR (Float, snd_musicvolume, 0.5f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) else { // Set general music volume. - GSnd->SetMusicVolume(clamp(self * relative_volume, 0, 1)); + if (GSnd != NULL) + { + GSnd->SetMusicVolume(clamp(self * relative_volume, 0, 1)); + } // For music not implemented through the digital sound system, // let them know about the change. if (currSong != NULL)