Abstain from handling connections instead if the level is loading

This commit is contained in:
JugadorXEI 2021-05-30 23:36:07 +02:00
parent 63f87b4cec
commit 4fdbfb1dc2
3 changed files with 17 additions and 23 deletions

View file

@ -5011,7 +5011,7 @@ FILESTAMP
{ {
node = (SINT8)doomcom->remotenode; node = (SINT8)doomcom->remotenode;
if (netbuffer->packettype == PT_CLIENTJOIN && server) if (netbuffer->packettype == PT_CLIENTJOIN && server && !levelloading)
{ {
HandleConnect(node); HandleConnect(node);
continue; continue;

View file

@ -1597,9 +1597,9 @@ void D_SRB2Main(void)
{ {
pagename = "TITLESKY"; pagename = "TITLESKY";
levelstarttic = gametic; levelstarttic = gametic;
G_SetGamestate(GS_LEVEL);
if (!P_SetupLevel(false)) if (!P_SetupLevel(false))
I_Quit(); // fail so reset game stuff I_Quit(); // fail so reset game stuff
G_SetGamestate(GS_LEVEL);
} }
#ifdef HAVE_DISCORDRPC #ifdef HAVE_DISCORDRPC

View file

@ -1733,20 +1733,6 @@ void G_DoLoadLevel(boolean resetplayer)
Y_EndIntermission(); Y_EndIntermission();
if (gamestate == GS_VOTING) if (gamestate == GS_VOTING)
Y_EndVote(); Y_EndVote();
// Don't allow people to download a partial/corrupted
// save while the server's loading the map/during the wipe.
// (this addresses "map" command usage, which means
// transitions/different gamestates would be skipped.)
if (gamestate == GS_LEVEL)
gamestate = GS_WAITINGPLAYERS;
// Setup the level.
if (!P_SetupLevel(false))
{
// fail so reset game stuff
Command_ExitGame_f();
return;
}
G_SetGamestate(GS_LEVEL); G_SetGamestate(GS_LEVEL);
@ -1756,6 +1742,14 @@ void G_DoLoadLevel(boolean resetplayer)
players[i].playerstate = PST_REBORN; players[i].playerstate = PST_REBORN;
} }
// Setup the level.
if (!P_SetupLevel(false))
{
// fail so reset game stuff
Command_ExitGame_f();
return;
}
if (!resetplayer) if (!resetplayer)
P_FindEmerald(); P_FindEmerald();