Mercurial > hg > openttd
changeset 18204:157bc2e2853d draft
(svn r23033) -Fix [FS#4776]: the last custom playlist items went lost when the files in the .obm are not contiguous
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 16 Oct 2011 19:53:02 +0000 |
parents | 67b103c3d56e |
children | 1e8e952310ab |
files | src/music_gui.cpp |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -84,7 +84,8 @@ void ValidatePlaylist(byte *playlist) { while (*playlist != 0) { - if (*playlist <= BaseMusic::GetUsedSet()->num_available) { + /* Song indices are saved off-by-one so 0 is "nothing". */ + if (*playlist <= NUM_SONGS_AVAILABLE && !StrEmpty(GetSongName(*playlist - 1))) { playlist++; continue; }