Upper-bound restrict the setting of numlaps for sectionrace levels mid-game

This commit is contained in:
toaster 2018-11-28 16:45:45 +00:00
parent d8955f1f87
commit 2c8855cd5f

View file

@ -4231,8 +4231,16 @@ static void PointLimit_OnChange(void)
static void NumLaps_OnChange(void)
{
if (!G_RaceGametype() || (modeattacking || demoplayback))
return;
if (server && Playing()
&& (netgame || multiplayer)
&& (mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
&& (cv_numlaps.value > mapheaderinfo[gamemap - 1]->numlaps))
CV_StealthSetValue(&cv_numlaps, mapheaderinfo[gamemap - 1]->numlaps);
// Just don't be verbose
if (G_RaceGametype() && !(modeattacking || demoplayback))
CONS_Printf(M_GetText("Number of laps set to %d\n"), cv_numlaps.value);
}