Mercurial > rinkhals
diff gamelib/sound.py @ 363:e23637457aa4
Prevent error stopping music when sound not initialized
author | David Fraser <davidf@sjsoft.com> |
---|---|
date | Tue, 08 Sep 2009 06:35:14 +0000 |
parents | 41db9f3ba29e |
children | 03d5cb669298 |
line wrap: on
line diff
--- a/gamelib/sound.py Mon Sep 07 15:31:22 2009 +0000 +++ b/gamelib/sound.py Tue Sep 08 06:35:14 2009 +0000 @@ -35,6 +35,8 @@ def stop_background_music(): """stops any playing background music""" global CURRENT_MUSIC_FILE + if not SOUND_INITIALIZED: + return CURRENT_MUSIC_FILE = None # TODO: fadeout in a background thread pygame.mixer.music.stop()