From 2e664f8716f53aa6eabc63dfd7480552a9b4459b Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 7 May 2012 19:12:01 +0200 Subject: [PATCH] Playback again the menu track when the music player is stopped (3 seconds later) --- qcsrc/menu/xonotic/soundlist.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qcsrc/menu/xonotic/soundlist.c b/qcsrc/menu/xonotic/soundlist.c index fea84a7ce..784b38c96 100644 --- a/qcsrc/menu/xonotic/soundlist.c +++ b/qcsrc/menu/xonotic/soundlist.c @@ -164,10 +164,14 @@ void SoundList_Filter_Change(entity box, entity me) void XonoticSoundList_stopSound(entity me) { - // STOP: list 0 is disabled by setting the index to 999 + // STOP: list 0 is disabled by setting the index to -1 // we set sampleposition0 to -1 to indicate that music is stopped - cvar_set("music_playlist_index", "999"); - localcmd("\nwait; music_playlist_sampleposition0 -1\n"); + if(cvar("music_playlist_index") != -1) // == 0 doesn't work when paused + { + cvar_set("music_playlist_index", "-1"); + localcmd("\nwait; music_playlist_sampleposition0 -1\n"); + localcmd("\ndefer 3 \"cd play $menu_cdtrack\"\n"); + } } void StopSound_Click(entity btn, entity me) -- 2.39.2