mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Use S_AttemptToRestoreMusic to handle music after server connection
Resolves #473
This commit is contained in:
parent
2fd7c7717c
commit
2dbb11af89
3 changed files with 11 additions and 9 deletions
|
|
@ -3960,6 +3960,9 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
|
||||||
playerconsole[newplayernum] = console;
|
playerconsole[newplayernum] = console;
|
||||||
G_BuildLocalSplitscreenParty(newplayernum);
|
G_BuildLocalSplitscreenParty(newplayernum);
|
||||||
|
|
||||||
|
if (node == mynode && splitscreenplayer == 0)
|
||||||
|
S_AttemptToRestoreMusic(); // Earliest viable point
|
||||||
|
|
||||||
if (netgame)
|
if (netgame)
|
||||||
{
|
{
|
||||||
char joinmsg[256];
|
char joinmsg[256];
|
||||||
|
|
|
||||||
|
|
@ -1362,7 +1362,7 @@ static UINT32 queue_fadeinms;
|
||||||
|
|
||||||
static tic_t pause_starttic;
|
static tic_t pause_starttic;
|
||||||
|
|
||||||
static void S_AttemptToRestoreMusic(void)
|
void S_AttemptToRestoreMusic(void)
|
||||||
{
|
{
|
||||||
switch (gamestate)
|
switch (gamestate)
|
||||||
{
|
{
|
||||||
|
|
@ -1376,6 +1376,9 @@ static void S_AttemptToRestoreMusic(void)
|
||||||
case GS_INTERMISSION:
|
case GS_INTERMISSION:
|
||||||
S_ChangeMusicInternal("racent", true);
|
S_ChangeMusicInternal("racent", true);
|
||||||
break;
|
break;
|
||||||
|
case GS_CEREMONY:
|
||||||
|
S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0);
|
||||||
|
break;
|
||||||
case GS_TITLESCREEN:
|
case GS_TITLESCREEN:
|
||||||
S_ChangeMusicInternal("_title", looptitle);
|
S_ChangeMusicInternal("_title", looptitle);
|
||||||
break;
|
break;
|
||||||
|
|
@ -2975,14 +2978,7 @@ void S_InitLevelMusic(boolean fromnetsave)
|
||||||
mapmusresume = 0;
|
mapmusresume = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
S_StopMusic(); // Starting ambience should always be restarted, if playing.
|
S_StopMusic();
|
||||||
|
|
||||||
if (leveltime < (starttime + (TICRATE/2))) // SRB2Kart
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0);
|
|
||||||
|
|
||||||
S_ResetMusicStack();
|
S_ResetMusicStack();
|
||||||
music_stack_noposition = false;
|
music_stack_noposition = false;
|
||||||
|
|
|
||||||
|
|
@ -346,6 +346,9 @@ void S_ResumeAudio(void);
|
||||||
void S_EnableSound(void);
|
void S_EnableSound(void);
|
||||||
void S_DisableSound(void);
|
void S_DisableSound(void);
|
||||||
|
|
||||||
|
// Attempt to restore music based on gamestate.
|
||||||
|
void S_AttemptToRestoreMusic(void);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Music Fading
|
// Music Fading
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue