Skip to content

Commit

Permalink
dont allow playlists with an unloaded chart to be played as a course,…
Browse files Browse the repository at this point in the history
… cause, yknow, it would crash
  • Loading branch information
MinaciousGrace committed May 15, 2017
1 parent 05898fc commit 5f4ab03
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ScreenSelectMusic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1876,6 +1876,12 @@ class LunaScreenSelectMusic: public Luna<ScreenSelectMusic>
{
SONGMAN->playlistcourse = SArg(1);
Playlist& pl = SONGMAN->allplaylists[SONGMAN->playlistcourse];

// dont allow playlists with an unloaded chart to be played as a course
FOREACH(Chart, pl.chartlist, ch)
if (!ch->loaded)
return 1;

p->GetMusicWheel()->SelectSong(pl.chartlist[0].songptr);
GAMESTATE->m_SongOptions.GetPreferred().m_fMusicRate = pl.chartlist[0].rate;
p->SelectCurrent(PLAYER_1);
Expand Down

0 comments on commit 5f4ab03

Please sign in to comment.