Skip to content

Commit

Permalink
reset the "prevmap" variable if the map has been left
Browse files Browse the repository at this point in the history
Plays the proper music if a map is reloaded from a savegame during the
intermission screen.

Fixes #113, thanks @Zodomaniac
  • Loading branch information
fabiangreffrath committed Jun 14, 2016
1 parent e56e173 commit f0bd87c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/doom/s_sound.c
Expand Up @@ -222,6 +222,7 @@ static void S_StopChannel(int cnum)
// Kills playing sounds at start of level,
// determines music if any, changes music.
//
static short prevmap;

void S_Start(void)
{
Expand Down Expand Up @@ -293,7 +294,6 @@ void S_Start(void)

// [crispy] do not change music if not changing map (preserves IDMUS choice)
{
static short prevmap;
const short curmap = (gameepisode << 8) + gamemap;

if (prevmap == curmap)
Expand Down Expand Up @@ -752,6 +752,11 @@ void S_ChangeMusic(int musicnum, int looping)
char namebuf[9];
void *handle;

if (gamestate != GS_LEVEL)
{
prevmap = 0;
}

// [crispy] play no music if this is not the right map
if (crispy_demowarp && (gamestate != GS_LEVEL || crispy_demowarp != gamemap))
return;
Expand Down

0 comments on commit f0bd87c

Please sign in to comment.