From d3986987298ea4009a283f1e4da9c71328a4cc4a Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 15 Dec 2021 17:28:31 +0000 Subject: [PATCH] Per Sal's request (slightly modified): * Do not allow any joining spectators if anybody got onto the last lap while not in FREE PLAY (this is the same condition as nospectategrief, for consistency). * Reset nospectategrief to 0 if there is literally nobody playing, to prevent a fully locked-out server. * This means it's not a problem to reset spectatorreentry even with the map command. * Change the default for spectatorreentry to 30 seconds, from 60. --- src/d_netcmd.c | 2 +- src/k_kart.c | 6 ++++++ src/p_setup.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2ca7e457..d5e5d9f2 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -248,7 +248,7 @@ static CV_PossibleValue_t ingamecap_cons_t[] = {{0, "MIN"}, {MAXPLAYERS-1, "MAX" consvar_t cv_ingamecap = {"ingamecap", "0", CV_NETVAR, ingamecap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t spectatorreentry_cons_t[] = {{0, "MIN"}, {10*60, "MAX"}, {0, NULL}}; -consvar_t cv_spectatorreentry = {"spectatorreentry", "60", CV_NETVAR, spectatorreentry_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_spectatorreentry = {"spectatorreentry", "30", CV_NETVAR, spectatorreentry_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t antigrief_cons_t[] = {{20, "MIN"}, {60, "MAX"}, {0, "Off"}, {0, NULL}}; consvar_t cv_antigrief = {"antigrief", "30", CV_NETVAR, antigrief_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/k_kart.c b/src/k_kart.c index 1c99a43e..a8b3374c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6339,6 +6339,12 @@ void K_CheckSpectateStatus(void) if (!numjoiners) return; + // 1.4: prevent last lap jerkitude + if (!numingame) // but allow empty netgames to recover + nospectategrief = 0; + if (nospectategrief > 1) + return; + // Organize by spectate wait timer #if 0 if (cv_ingamecap.value) diff --git a/src/p_setup.c b/src/p_setup.c index 5956a5f9..24241a7f 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2396,6 +2396,8 @@ static void P_LevelInitStuff(void) players[i].exiting = 0; P_ResetPlayer(&players[i]); + players[i].spectatorreentry = 0; // SRB2Kart 1.4 + players[i].mo = NULL; // we must unset axis details too