can play correct wc2 tracks for ShowStats()
This commit is contained in:
parent
b1e8ae35d0
commit
ffde756ebb
3 changed files with 22 additions and 1 deletions
src
|
@ -240,6 +240,8 @@ extern char *CDMode;
|
|||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
/// FIXME: docu
|
||||
extern int CDTrack;
|
||||
/// FIXME: docu
|
||||
extern char *CDPlaySection;
|
||||
#endif
|
||||
|
||||
#if defined(USE_SDLCD)
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
#include "sound.h"
|
||||
#include "sound_server.h"
|
||||
#include "interface.h"
|
||||
#include "campaign.h"
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
-- Declaration
|
||||
|
@ -69,6 +70,7 @@ global Sample* MusicSample; /// Music samples
|
|||
global char *CDMode = ":off"; /// cd play mode, ":off" ":random" ":all" or ":wc2"
|
||||
#if defined(USE_SDLCD) || defined(USE_LIBCDA) || defined(USE_CDDA)
|
||||
global int CDTrack = 0; /// Current cd track
|
||||
global char *CDPlaySection = "menu";
|
||||
#endif
|
||||
|
||||
#if defined(USE_SDLCD)
|
||||
|
@ -360,7 +362,21 @@ global int PlayCDRom(const char* name)
|
|||
if (!strcmp(name, ":wc2")) {
|
||||
CDMode = ":wc2";
|
||||
track = cd_current_track();
|
||||
if (!GameRunning && track != 15) {
|
||||
if (!strcmp(CDPlaySection, "showstats")) {
|
||||
if (GameResult == GameVictory) {
|
||||
if (!ThisPlayer->Race && track != 8) {
|
||||
cd_play(8);
|
||||
} else if (ThisPlayer->Race && track != 16) {
|
||||
cd_play(16);
|
||||
}
|
||||
} else {
|
||||
if (!ThisPlayer->Race && track != 9) {
|
||||
cd_play(9);
|
||||
} else if (ThisPlayer->Race && track != 17) {
|
||||
cd_play(17);
|
||||
}
|
||||
}
|
||||
} else if (!GameRunning && track != 15) {
|
||||
cd_play(15);
|
||||
} else if (GameRunning && !ThisPlayer->Race && (track < 3 || track > 7)) {
|
||||
do CDTrack = (MyRand() % NumCDTracks) + 3;
|
||||
|
|
|
@ -812,6 +812,8 @@ global void GameMainLoop(void)
|
|||
}
|
||||
|
||||
if( GameResult==GameVictory || GameResult==GameDefeat ) {
|
||||
CDPlaySection = "showstats";
|
||||
CDRomCheck(NULL);
|
||||
ShowStats();
|
||||
}
|
||||
|
||||
|
@ -819,6 +821,7 @@ global void GameMainLoop(void)
|
|||
ReplayRevealMap=0;
|
||||
GamePaused=0;
|
||||
GodMode=0;
|
||||
CDPlaySection = "menu";
|
||||
}
|
||||
|
||||
//@}
|
||||
|
|
Loading…
Add table
Reference in a new issue