Remove ogg_shuffle 4, it confused users.

Random playback should never play the same track twice in a row, it
should always choose another track. Discussed in #1318, closes #1318.
This commit is contained in:
Yamagi 2026-08-01 18:00:50 +02:00
parent 20d528a143
commit e155d71794
3 changed files with 4 additions and 21 deletions

View file

@ -348,10 +348,7 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
- `0`: Loop the current track (the default).
- `1`: Play the current track once, then stop.
- `2`: Play all available tracks in a linear sequence.
- `3`: Shuffle through the available tracks, never play the same track
twice in a row.
- `4`: Shuffle through the available tracks, may play the same track
multiple times in a row.
- `3`: Shuffle through the available tracks.
* **s_doppler**: If set to `1` doppler effects are enabled. This is only
supported by the OpenAL sound backend.

View file

@ -2529,7 +2529,6 @@ Options_MenuInit(void)
"play once",
"sequential",
"random",
"truly random",
NULL
};

View file

@ -531,23 +531,10 @@ OGG_PlayTrack(const char *track, qboolean cdtrack, qboolean immediate)
newtrack = (curtrack + 1) % (ogg_maxfileindex + 1) != 0 ? (curtrack + 1) : 2;
} break;
case 3: // random
case 4: // random with true randomness
{
int retries = 100;
newtrack = 0;
while (retries-- > 0 && newtrack < 2)
{
newtrack = randk() % (ogg_maxfileindex + 1);
if (playback == 3)
{
if (newtrack == curtrack)
{
newtrack = 0;
}
}
}
newtrack = (randk() % (ogg_maxfileindex - 1) + 2);
newtrack = (newtrack == curtrack) ? newtrack + 1 : newtrack;
newtrack = (newtrack > ogg_maxfileindex) ? 2 : newtrack;
} break;
}