handle music reloadreset stuff in seperate function
just tryin make it less ugly
This commit is contained in:
1 parent
0aec9a85bb
commit
eb512022e0
3 files changed
+24
-27
No files matched your search
+1
-12
@@ -2304,18 +2304,7 @@ void G_PlayerReborn(INT32 player)
|
||||
{
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
{
|
||||
if (keepmusic)
|
||||
{
|
||||
S_CopyKeepMusicStuff(); // this is horrible, why do we COMPLETELY need to reset the music on respawn?? oh well
|
||||
}
|
||||
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;
|
||||
S_HandleReloadResetMusic();
|
||||
songcredit = true;
|
||||
}
|
||||
}
|
||||
|
||||
+22
-15
@@ -2041,6 +2041,27 @@ void S_KeepMusic(void)
|
||||
oldmap = gamemap;
|
||||
}
|
||||
|
||||
void S_HandleReloadResetMusic(void)
|
||||
{
|
||||
if (!(mapmusflags & MUSIC_RELOADRESET))
|
||||
return;
|
||||
|
||||
if (keepmusic)
|
||||
{
|
||||
// this is horrible, this copies over everything about the mapmusic into temporary variables to reuse
|
||||
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;
|
||||
}
|
||||
|
||||
//
|
||||
// Per level startup code.
|
||||
// Kills playing sounds at start of level,
|
||||
@@ -2048,21 +2069,7 @@ void S_KeepMusic(void)
|
||||
//
|
||||
void S_InitMapMusic(void)
|
||||
{
|
||||
if (mapmusflags & MUSIC_RELOADRESET)
|
||||
{
|
||||
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;
|
||||
}
|
||||
S_HandleReloadResetMusic();
|
||||
|
||||
if (keepmusic)
|
||||
{
|
||||
|
||||
@@ -113,6 +113,7 @@ void S_ResetKeepAndSpecialMus(void);
|
||||
|
||||
void S_InitMapMusic(void);
|
||||
void S_StartMapMusic(void);
|
||||
void S_HandleReloadResetMusic(void);
|
||||
|
||||
void S_KeepMusic(void);
|
||||
void S_CopyKeepMusicStuff(void);
|
||||
|
||||
Reference in new issue
Block a user