diff --git a/src/music.cpp b/src/music.cpp index bcc9955..84240c1 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -66,6 +66,8 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f if (ret) { this->num_available = 0; this->has_theme = !StrEmpty(this->files[0].filename); + + uint next_track_nr = 1; IniGroup *names = ini->GetGroup("names"); for (uint i = 0, j = 1; i < lengthof(this->song_name); i++) { @@ -94,8 +96,10 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f } strecpy(this->song_name[i], item->value, lastof(this->song_name[i])); - this->track_nr[i] = j++; this->num_available++; + + /* if there is a theme song, number that one zero */ + this->track_nr[i] = (i==0 && this->has_theme) ? 0 : next_track_nr++; } } return ret; diff --git a/src/music_gui.cpp b/src/music_gui.cpp index da32c79..32cf65d 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -109,6 +109,7 @@ void InitializeMusic() uint j = 0; for (uint i = 0; i < NUM_SONGS_AVAILABLE; i++) { if (StrEmpty(GetSongName(i))) continue; + if (i == 0 && BaseMusic::GetUsedSet()->has_theme) continue; _playlist_all[j++] = i + 1; } /* Terminate the list */