- fixed: RR: save the current track for the "8-track player"

This way a saved game can properly resume the loop.
This commit is contained in:
Christoph Oelckers 2022-10-01 09:16:47 +02:00
parent 57228f12a3
commit 64a96e1b94
3 changed files with 4 additions and 2 deletions

View file

@ -130,6 +130,7 @@ extern short BellTime;
extern uint8_t enemysizecheat /*raat607*/, ufospawnsminion, pistonsound, chickenphase /* raat605*/, RRRA_ExitedLevel, fogactive;
extern uint32_t everyothertime;
extern player_orig po[MAXPLAYERS];
extern int32_t g_cdTrack;
END_DUKE_NS

View file

@ -444,6 +444,7 @@ void GameInterface::SerializeGameState(FSerializer& arc)
("fogactive", fogactive)
("thunder_brightness", thunder_brightness)
.Array("po", po, ud.multimode)
("rrcdtrack", g_cdTrack)
.EndObject();
lava_serialize(arc);

View file

@ -54,6 +54,8 @@ CVAR(Bool, wt_commentary, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
BEGIN_DUKE_NS
int32_t g_cdTrack = -1;
static FSoundID currentCommentarySound;
void UnmuteSounds()
@ -693,8 +695,6 @@ void S_PlaySpecialMusic(unsigned int m)
void S_PlayRRMusic(int newTrack)
{
static int32_t g_cdTrack = -1;
if (!isRR() || !mus_redbook || cd_disabled || currentLevel->music.IsNotEmpty())
return;
Mus_Stop();