Fix starttrack crashing when a "null music" is selected.

Introduced with the refactoring in r3490.

git-svn-id: https://svn.eduke32.com/eduke32@3542 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-03-03 16:06:40 +00:00
parent 0646e41fa4
commit 2d01a81435

View file

@ -1003,10 +1003,11 @@ int32_t G_StartTrack(int32_t level)
{ {
int32_t musicIndex = MAXLEVELS*ud.volume_number + level; int32_t musicIndex = MAXLEVELS*ud.volume_number + level;
if (MapInfo[g_musicIndex].musicfn != NULL) if (MapInfo[musicIndex].musicfn != NULL)
{ {
// Only set g_musicIndex on success.
g_musicIndex = musicIndex; g_musicIndex = musicIndex;
S_PlayMusic(MapInfo[g_musicIndex].musicfn, g_musicIndex); S_PlayMusic(MapInfo[musicIndex].musicfn, g_musicIndex);
return 0; return 0;
} }