attemp to fix playerreborn resetting keepmusic
This commit is contained in:
1 parent
0774274e9c
commit
c6451208ad
3 files changed
+27
-11
No files matched your search
+11
-4
@@ -2304,10 +2304,17 @@ void G_PlayerReborn(INT32 player)
|
||||
{
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
{
|
||||
strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7);
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
if (keepmusic)
|
||||
{
|
||||
S_CopyKeepMusicStuff();
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7);
|
||||
mapmusname[6] = 0;
|
||||
mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK);
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
}
|
||||
mapmusresume = 0;
|
||||
songcredit = true;
|
||||
}
|
||||
|
||||
+15
-7
@@ -1827,8 +1827,6 @@ void S_StopMusic(void)
|
||||
|
||||
mapmusresume = (cv_birdmusic.value && (strcasecmp(music_name, mapmusname) == 0)) ? I_GetSongPosition() : 0;
|
||||
|
||||
S_SetKeepMusicPosition();
|
||||
|
||||
if (I_SongPaused())
|
||||
I_ResumeSong();
|
||||
|
||||
@@ -1999,6 +1997,17 @@ static void S_ClearKeepMusicPosition(void)
|
||||
keepmusposition = 0;
|
||||
}
|
||||
|
||||
void S_CopyKeepMusicStuff(void)
|
||||
{
|
||||
CONS_Printf("using %s\n", keepmusname);
|
||||
strncpy(mapmusname, keepmusname, 7);
|
||||
mapmusflags = keepmusflags;
|
||||
if (keepmusicresume)
|
||||
mapmusposition = keepmusposition;
|
||||
else
|
||||
mapmusposition = mapheaderinfo[gamemap-1]->muspos;
|
||||
}
|
||||
|
||||
// determine if we should keep the music on a map restart
|
||||
void S_KeepMusic(void)
|
||||
{
|
||||
@@ -2006,6 +2015,8 @@ void S_KeepMusic(void)
|
||||
static boolean oldencore = false;
|
||||
const boolean musicchanged = S_CheckMusicException();
|
||||
|
||||
S_SetKeepMusicPosition();
|
||||
|
||||
if (!cv_keepmusic.value)
|
||||
{
|
||||
keepmusic = keepmusicresume = false;
|
||||
@@ -2034,12 +2045,9 @@ void S_InitMapMusic(void)
|
||||
{
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
{
|
||||
if (keepmusic && keepmusicresume)
|
||||
if (keepmusic)
|
||||
{
|
||||
CONS_Printf("using %s\n", keepmusname);
|
||||
strncpy(mapmusname, keepmusname, 7);
|
||||
mapmusflags = keepmusflags;
|
||||
mapmusposition = keepmusposition;
|
||||
S_CopyKeepMusicStuff();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -115,6 +115,7 @@ void S_InitMapMusic(void);
|
||||
void S_StartMapMusic(void);
|
||||
|
||||
void S_KeepMusic(void);
|
||||
void S_CopyKeepMusicStuff(void);
|
||||
|
||||
// Stops music and restarts it from same position. Used for instant applying changes to amiga filters.
|
||||
void S_RestartMusic(void);
|
||||
|
||||
Reference in new issue
Block a user