projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1240eda
)
Fix crash on ESC press when no music is playing
author
Tobias Markus
<tobbi@mozilla-uk.org>
Thu, 19 Mar 2015 12:22:44 +0000
(13:22 +0100)
committer
Tobias Markus
<tobbi@mozilla-uk.org>
Thu, 19 Mar 2015 12:22:44 +0000
(13:22 +0100)
src/audio/sound_manager.cpp
patch
|
blob
|
history
diff --git
a/src/audio/sound_manager.cpp
b/src/audio/sound_manager.cpp
index
ace96c1
..
3740d71
100644
(file)
--- a/
src/audio/sound_manager.cpp
+++ b/
src/audio/sound_manager.cpp
@@
-303,6
+303,9
@@
SoundManager::play_music(const std::string& filename, bool fade)
void
SoundManager::pause_music(float fadetime)
{
+ if(music_source == NULL || !music_source->playing())
+ return;
+
if(fadetime > 0) {
if(music_source
&& music_source->get_fade_state() != StreamSoundSource::FadingPause)
@@
-315,6
+318,9
@@
SoundManager::pause_music(float fadetime)
void
SoundManager::resume_music(float fadetime)
{
+ if(music_source == NULL || !music_source->paused())
+ return;
+
if(fadetime > 0) {
if(music_source
&& music_source->get_fade_state() != StreamSoundSource::FadingResume)