diff --git a/src/g_game.c b/src/g_game.c index 39f1bbb3f..f5aab99a9 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2755,18 +2755,7 @@ void G_PlayerReborn(INT32 player) } } - if (S_MusicPlaying()) - { - P_RestoreMusic(p); - /* mid-way fading out, fade back up */ - S_FadeMusic(100, cv_respawnfademusicback.value); - } - else - { - /* this could be considered a hack, but I like it ...kinda */ - S_SetRestoreMusicFadeInCvar(&cv_respawnfademusicback); - P_RestoreMusic(p); - } + P_RestoreMusic(p); if (songcredit) S_ShowMusicCredit(); diff --git a/src/p_inter.c b/src/p_inter.c index e4331e039..12fbcf6dd 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2331,19 +2331,22 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } target->player->playerstate = PST_DEAD; - if (netgame || multiplayer) - ms = cv_respawntime.value * 1000; - else - ms = 1000; + if (P_IsLocalPlayer(target->player)) + { + if (netgame || multiplayer) + ms = cv_respawntime.value * 1000; + else + ms = 1000; - /* - If the time spent with the music paused is less than half - a second, continue playing the song (just mute it). - */ - if (( ms - cv_respawnfademusicout.value ) < 500) - S_FadeMusic(0, cv_respawnfademusicout.value); - else - S_FadeOutStopMusic(cv_respawnfademusicout.value); + /* + If the time spent with the music paused is less than half + a second, continue playing the song (just mute it). + */ + if (( ms - cv_respawnfademusicout.value ) < 500) + S_FadeMusic(0, cv_respawnfademusicout.value); + else + S_FadeOutStopMusic(cv_respawnfademusicout.value); + } if (target->player == &players[consoleplayer]) { diff --git a/src/p_user.c b/src/p_user.c index 5fee0ac9b..80f206d7c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1189,6 +1189,8 @@ boolean P_EndingMusic(player_t *player) void P_RestoreMusic(player_t *player) { UINT32 position; + boolean playing; + int fadein; if (!P_IsLocalPlayer(player)) // Only applies to a local player return; @@ -1269,10 +1271,25 @@ void P_RestoreMusic(player_t *player) else position = mapmusposition; - S_ChangeMusicEx(mapmusname, mapmusflags, true, position, 0, - S_GetRestoreMusicFadeIn()); + playing = S_MusicPlaying(); + + /* + So if the music isn't playing, it's + most likely because we were dead. + */ + if (! playing) + fadein = cv_respawnfademusicback.value; + + if (playing || ! fadein) + fadein = S_GetRestoreMusicFadeIn(); + + S_ChangeMusicEx(mapmusname, mapmusflags, true, position, 0, fadein); S_ClearRestoreMusicFadeInCvar(); mapmusresume = 0; + + /* mid-way fading out, fade back up */ + if (playing) + S_FadeMusic(100, cv_respawnfademusicback.value); } } }