From: terencehill Date: Mon, 5 Aug 2013 13:14:55 +0000 (+0200) Subject: Simplify the code: thanks to the latest changes there's no need to set music_playlist... X-Git-Tag: xonotic-v0.8.1~157^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ecf04f035024edeb4d143e1e3d3df5fea2153903;p=xonotic%2Fxonotic-data.pk3dir.git Simplify the code: thanks to the latest changes there's no need to set music_playlist_sampleposition0 to -1 when stopping playlist music anymore --- 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));