playlists now work

This commit is contained in:
nehalmistry 2003-02-17 01:32:12 +00:00
parent 56619032a7
commit fa0657b279
2 changed files with 14 additions and 5 deletions
src
sound
stratagus

View file

@ -482,6 +482,14 @@ global void PlaySectionMusic(PlaySectionType section)
j = 0;
track = cd_current_track();
if (section == PlaySectionStats) {
if (GameResult == GameVictory) {
section = PlaySectionStatsVictory;
} else {
section = PlaySectionStatsDefeat;
}
}
for (i = 0; i < NumPlaySections; ++i) {
if (PlaySections[i].Type == section && (!PlaySections[i].Race ||
!(strcmp(PlaySections[i].Race, ThisPlayer->RaceName)))) {
@ -503,8 +511,9 @@ global void PlaySectionMusic(PlaySectionType section)
} else if (PlaySections[i].CDOrder == PlaySectionOrderRandom) {
do {
newtrack = MyRand() % NumCDTracks;
} while ( ((newtrack << j) & PlaySections[i].CDTracks) &&
(cd_is_audio(CDTrack) < 1) );
printf("%d\n", newtrack);
} while ( !((1 << newtrack) & PlaySections[i].CDTracks) ||
(cd_is_audio(newtrack) < 1) );
}
}
if (newtrack) {

View file

@ -907,13 +907,13 @@ global void SavePreferences(void)
buf[0] = '\0';
switch (CDMode) {
case CDModeAll:
strcpy(buf, "all");
strcpy(buf, "'all");
break;
case CDModeRandom:
strcpy(buf, "random");
strcpy(buf, "'random");
break;
case CDModeDefined:
strcpy(buf, "defined");
strcpy(buf, "'defined");
break;
default:
break;