From 56619032a77b51299d0d31a0349e746346c93c1d Mon Sep 17 00:00:00 2001 From: jsalmon3 <> Date: Mon, 17 Feb 2003 01:27:33 +0000 Subject: [PATCH] Cleanup, don't crash if no play sections are defined --- src/sound/music.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/sound/music.cpp b/src/sound/music.cpp index ab9ef752e..cc2a183ff 100644 --- a/src/sound/music.cpp +++ b/src/sound/music.cpp @@ -462,13 +462,24 @@ local int PlayCDRom(const char* name) } #endif +/** +** FIXME: docu +*/ global void PlaySectionMusic(PlaySectionType section) { - int track, newtrack = 0; + int track; + int newtrack; int i; - int j = 0; - int found, numfiles; + int j; + int found; + int numfiles; + if (NumPlaySections == 0) { + return; + } + + newtrack = 0; + j = 0; track = cd_current_track(); for (i = 0; i < NumPlaySections; ++i) {