diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 392f0e5af13533ddb61f9adfde9d3882e18c4bb0..fbdf60baea0ff1edfb5dbc27f7a04076be30afa8 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4100,7 +4100,7 @@ static void Command_ExitLevel_f(void) CONS_Printf(M_GetText("This only works in a netgame.\n")); else if (!(server || (IsPlayerAdmin(consoleplayer)))) CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n")); - else if (gamestate != GS_LEVEL || demoplayback) + else if (( gamestate != GS_LEVEL && gamestate != GS_CREDITS ) || demoplayback) CONS_Printf(M_GetText("You must be in a level to use this.\n")); else SendNetXCmd(XD_EXITLEVEL, NULL, 0); diff --git a/src/g_game.c b/src/g_game.c index af17b2b289fdc03d7aa18fe85f6684e5f1ba9a0c..2ad0b12d9658076c95c7766f95ec727ed05095ae 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -15,6 +15,7 @@ #include "console.h" #include "d_main.h" #include "d_player.h" +#include "d_clisrv.h" #include "f_finale.h" #include "p_setup.h" #include "p_saveg.h" @@ -1847,7 +1848,9 @@ boolean G_Responder(event_t *ev) if (F_CreditResponder(ev)) { - F_StartGameEvaluation(); + // Skip credits for everyone + if (!netgame || server || IsPlayerAdmin(consoleplayer)) + SendNetXCmd(XD_EXITLEVEL, NULL, 0); return true; } } @@ -2843,6 +2846,10 @@ void G_ExitLevel(void) // Remove CEcho text on round end. HU_ClearCEcho(); } + else if (gamestate == GS_CREDITS) + { + F_StartGameEvaluation(); + } } // See also the enum GameType in doomstat.h diff --git a/src/w_wad.c b/src/w_wad.c index 7ef62aabc9bf7a24147309b6bde5b83829085797..82ef21d7fd1123267f21c120b8ec0446f383af82 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -578,14 +578,14 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) { CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle))); Z_Free(lumpinfo); - free(zentry); + free(zentries); return NULL; } if (memcmp(zentry->signature, pat_central, 4)) { CONS_Alert(CONS_ERROR, "Central directory is corrupt\n"); Z_Free(lumpinfo); - free(zentry); + free(zentries); return NULL; } @@ -598,7 +598,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) { CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle))); Z_Free(lumpinfo); - free(zentry); + free(zentries); free(fullname); return NULL; } @@ -640,6 +640,8 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) } } + free(zentries); + *nlmp = numlumps; return lumpinfo; } @@ -1306,8 +1308,9 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si { size = 0; zerr(zErr); - (void)inflateEnd(&strm); } + + (void)inflateEnd(&strm); } else {