From ecf04f035024edeb4d143e1e3d3df5fea2153903 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 5 Aug 2013 15:14:55 +0200 Subject: [PATCH] Simplify the code: thanks to the latest changes there's no need to set music_playlist_sampleposition0 to -1 when stopping playlist music anymore --- qcsrc/menu/xonotic/playlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qcsrc/menu/xonotic/playlist.c b/qcsrc/menu/xonotic/playlist.c index b216fac0c..ce670816b 100644 --- a/qcsrc/menu/xonotic/playlist.c +++ b/qcsrc/menu/xonotic/playlist.c @@ -195,11 +195,11 @@ void XonoticPlayList_drawListBoxItem(entity me, float i, vector absSize, float i void XonoticPlayList_stopSound(entity me) { // STOP: list 0 is disabled by setting the index to -1 - // we set sampleposition0 to -1 to indicate that music is stopped + // we set sampleposition0 to 0 to forget the position that the engine saves in this frame (for this reason we need to wait a frame) if(cvar("music_playlist_index") == 0 || cvar("music_playlist_index") == 999) { cvar_set("music_playlist_index", "-1"); - localcmd("\nwait; music_playlist_sampleposition0 -1\n"); + localcmd("\nwait; music_playlist_sampleposition0 0\n"); localcmd("\ndefer 3 \"cd play $menu_cdtrack\"\n"); } } @@ -224,7 +224,7 @@ void XonoticPlayList_startSound(entity me, float offset) else f = me.selectedItem; // START: list 0 is disabled by setting the index to 999 - // we set current0 to the selected track and sampleposition0 to 0 to forget value saved by the engine + // we set current0 to the selected track and sampleposition0 to 0 to forget the position that the engine saves in this frame (for this reason we need to wait a frame) // then we switch back to list 0 cvar_set("music_playlist_index", "999"); cvar_set("music_playlist_current0", ftos(f)); -- 2.39.2