Merge branch 'make-credits-great-again' into 'next'

Prevent just anyone from skipping credits but allow admins

See merge request STJr/SRB2!478
This commit is contained in:
Monster Iestyn 2019-06-22 16:13:04 -04:00
commit 755e4a8b2c
2 changed files with 9 additions and 2 deletions

View file

@ -4000,7 +4000,7 @@ static void Command_ExitLevel_f(void)
CONS_Printf(M_GetText("This only works in a netgame.\n")); CONS_Printf(M_GetText("This only works in a netgame.\n"));
else if (!(server || (IsPlayerAdmin(consoleplayer)))) else if (!(server || (IsPlayerAdmin(consoleplayer))))
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n")); 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")); CONS_Printf(M_GetText("You must be in a level to use this.\n"));
else else
SendNetXCmd(XD_EXITLEVEL, NULL, 0); SendNetXCmd(XD_EXITLEVEL, NULL, 0);

View file

@ -15,6 +15,7 @@
#include "console.h" #include "console.h"
#include "d_main.h" #include "d_main.h"
#include "d_player.h" #include "d_player.h"
#include "d_clisrv.h"
#include "f_finale.h" #include "f_finale.h"
#include "p_setup.h" #include "p_setup.h"
#include "p_saveg.h" #include "p_saveg.h"
@ -1874,7 +1875,9 @@ boolean G_Responder(event_t *ev)
if (F_CreditResponder(ev)) if (F_CreditResponder(ev))
{ {
F_StartGameEvaluation(); // Skip credits for everyone
if (!netgame || server || IsPlayerAdmin(consoleplayer))
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
return true; return true;
} }
} }
@ -2696,6 +2699,10 @@ void G_ExitLevel(void)
// Remove CEcho text on round end. // Remove CEcho text on round end.
HU_ClearCEcho(); HU_ClearCEcho();
} }
else if (gamestate == GS_CREDITS)
{
F_StartGameEvaluation();
}
} }
// See also the enum GameType in doomstat.h // See also the enum GameType in doomstat.h