From a60052b35da1d627dc3cc72f8e5c0200deffadb3 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 11 Aug 2022 23:18:48 +0100 Subject: [PATCH] Fix changing gamespeed from the menu, for real I originally wrote a ridiculous attempt at reimplementing the existing value rollaround. For one reason or another, that sidesteps net transmission. Let's just avoid all those hacks and limit our influence to changing the maximum allowed range. --- src/command.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/command.c b/src/command.c index 09c52b7a..6064291d 100644 --- a/src/command.c +++ b/src/command.c @@ -1725,6 +1725,7 @@ void CV_AddValue(consvar_t *var, INT32 increment) if (var->PossibleValue[max].value == var->value) currentindice = max; + // The following options will NOT handle netsyncing. if (var == &cv_chooseskin) { // Special case for the chooseskin variable, used only directly from the menu @@ -1783,28 +1784,7 @@ void CV_AddValue(consvar_t *var, INT32 increment) } else if (var == &cv_kartspeed) { - INT32 maxspeed = (M_SecretUnlocked(SECRET_HARDSPEED) ? 2 : 1); - // Special case for the kartspeed variable, used only directly from the menu to prevent selecting hard mode - if (increment > 0) // Going up! - { - newvalue = var->value + 1; - if (newvalue > maxspeed) - newvalue = 0; - var->value = newvalue; - var->string = var->PossibleValue[var->value].strvalue; - var->func(); - return; - } - else if (increment < 0) // Going down! - { - newvalue = var->value - 1; - if (newvalue < 0) - newvalue = maxspeed; - var->value = newvalue; - var->string = var->PossibleValue[var->value].strvalue; - var->func(); - return; - } + max = (M_SecretUnlocked(SECRET_HARDSPEED) ? 3 : 2); } #ifdef PARANOIA if (currentindice == -1)