Fix pointlimit messages occouring in singleplayer contexts

Still an awful child that hasn't shaped up like their sister cv_timelimit, but this will do for now.
This commit is contained in:
toaster 2022-10-15 15:51:57 +01:00
parent 414550dc3b
commit 52c0e145be

View file

@ -4912,7 +4912,12 @@ void ItemFinder_OnChange(void)
*/ */
static void PointLimit_OnChange(void) static void PointLimit_OnChange(void)
{ {
// Don't allow pointlimit in Single Player/Co-Op/Race! if (K_CanChangeRules(false) == false)
{
return;
}
// Don't allow pointlimit in non-pointlimited gametypes!
if (server && Playing() && !(gametyperules & GTR_POINTLIMIT)) if (server && Playing() && !(gametyperules & GTR_POINTLIMIT))
{ {
if (cv_pointlimit.value) if (cv_pointlimit.value)
@ -4927,7 +4932,7 @@ static void PointLimit_OnChange(void)
cv_pointlimit.value, cv_pointlimit.value,
cv_pointlimit.value > 1 ? "s" : ""); cv_pointlimit.value > 1 ? "s" : "");
} }
else if (netgame || multiplayer) else
CONS_Printf(M_GetText("Point limit disabled\n")); CONS_Printf(M_GetText("Point limit disabled\n"));
} }