From cbcb6c8ef40470a3144465e92c0c83e3ac427e9a Mon Sep 17 00:00:00 2001 From: John Anthony Date: Sat, 4 Aug 2012 19:07:17 +0100 Subject: Moved music restart hook to the loading function --- nyan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nyan.c b/nyan.c index d9ccd1f..e4bc59c 100644 --- a/nyan.c +++ b/nyan.c @@ -354,7 +354,6 @@ init(void) { load_music(); Mix_PlayMusic(music, 0); Mix_VolumeMusic(sound_volume); - Mix_HookMusicFinished(restart_music); } /* Choose our image set */ @@ -450,6 +449,8 @@ load_music(void) { } if (!music) printf("Unable to load Ogg file: %s\n", Mix_GetError()); + else + Mix_HookMusicFinished(restart_music); } static void -- cgit v1.2.3