]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
If music_playlist_randomX is set randomize the starting track too terencehill/randomize_first_song
authorterencehill <piuntn@gmail.com>
Sat, 5 May 2012 23:39:58 +0000 (01:39 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 5 May 2012 23:43:29 +0000 (01:43 +0200)
Signed-off-by: terencehill <piuntn@gmail.com>
cd_shared.c

index 43b4a7f43338cadf08df419faf21c4da21ac66d2..0ae5cd59f6c3eafa02f0b781dc182bdf1a1e5146 100644 (file)
@@ -638,14 +638,12 @@ void CDAudio_StartPlaylist(qboolean resume)
                }
                if (count > 0)
                {
-                       // position < 0 means never resume track
-                       if (position < 0)
-                               position = 0;
                        // advance to next track in playlist if the last one ended
-                       if (!resume)
+                       if (!resume || position < 0) // position < 0 means never resume track
                        {
                                position = 0;
-                               current++;
+                               if (!resume)
+                                       current++;
                                if (randomplay)
                                        current = (int)lhrandom(0, count);
                        }