P_LoadLevel is a mess, but attempt to fix a few things that shouldn't be happening with resyncs, including #209. Untested.

This commit is contained in:
toaster 2022-02-14 15:43:56 +00:00
parent 4b1cef0f20
commit 6d851f2bc8
2 changed files with 14 additions and 11 deletions

View file

@ -4496,7 +4496,8 @@ static inline boolean P_NetUnArchiveMisc(boolean reloading)
// tell the sound code to reset the music since we're skipping what
// normally sets this flag
mapmusflags |= MUSIC_RELOADRESET;
if (!reloading)
mapmusflags |= MUSIC_RELOADRESET;
G_SetGamestate(READINT16(save_p));

View file

@ -3943,9 +3943,12 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
// will be set by player think.
players[consoleplayer].viewz = 1;
// Cancel all d_main.c fadeouts (keep fade in though).
if (reloadinggamestate)
wipegamestate = gamestate; // Don't fade if reloading the gamestate
// Encore mode fade to pink to white
// This is handled BEFORE sounds are stopped.
if (encoremode && !prevencoremode && !demo.rewinding)
else if (encoremode && !prevencoremode && !demo.rewinding)
{
if (rendermode != render_none)
{
@ -4007,10 +4010,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
}
}
// Cancel all d_main.c fadeouts (keep fade in though).
if (reloadinggamestate)
wipegamestate = gamestate; // Don't fade if reloading the gamestate
// Special stage & record attack retry fade to white
// This is handled BEFORE sounds are stopped.
if (G_GetModeAttackRetryFlag())
@ -4032,7 +4031,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
// Let's fade to white here
// But only if we didn't do the encore startup wipe
if (!demo.rewinding)
if (!demo.rewinding && !reloadinggamestate)
{
// Make sure all sounds are stopped before Z_FreeTags.
S_StopSounds();
@ -4204,10 +4203,9 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
{
P_InitCamera();
memset(localaiming, 0, sizeof(localaiming));
K_InitDirector();
}
K_InitDirector();
wantedcalcdelay = wantedfrequency*2;
indirectitemcooldown = 0;
hyubgone = 0;
@ -4237,7 +4235,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
if (!(netgame || multiplayer || demo.playback) && !majormods)
mapvisited[gamemap-1] |= MV_VISITED;
else if (netgame || multiplayer)
else if (!demo.playback)
mapvisited[gamemap-1] |= MV_MP; // you want to record that you've been there this session, but not permanently
G_AddMapToBuffer(gamemap-1);
@ -4260,7 +4258,11 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
lastmaploaded = gamemap; // HAS to be set after saving!!
}
if (grandprixinfo.gp == true)
if (reloadinggamestate)
{
CONS_Printf("Gamestate reloaded; bot infomation may be corrupted, requires further testing...\n");
}
else if (grandprixinfo.gp == true)
{
if (grandprixinfo.initalize == true)
{