Instead of reverting kartspeed on invalid set, prevent it from being set in the first place, just like Encore! Should resolve desync.

This commit is contained in:
toaster 2022-07-10 19:23:43 +01:00
parent 8c91b3650f
commit cb5da4c3c3
2 changed files with 9 additions and 7 deletions

View file

@ -1533,6 +1533,15 @@ static void CV_SetCVar(consvar_t *var, const char *value, boolean stealth)
return;
}
if (var == &cv_kartspeed && !M_SecretUnlocked(SECRET_HARDSPEED))
{
if (!stricmp(value, "Hard") || atoi(value) == 2)
{
CONS_Printf(M_GetText("You haven't unlocked this yet!\n"));
return;
}
}
// Only add to netcmd buffer if in a netgame, otherwise, just change it.
if (netgame || multiplayer)
{

View file

@ -5728,13 +5728,6 @@ static void KartFrantic_OnChange(void)
static void KartSpeed_OnChange(void)
{
if (!M_SecretUnlocked(SECRET_HARDSPEED) && cv_kartspeed.value == 2)
{
CONS_Printf(M_GetText("You haven't earned this yet.\n"));
CV_StealthSetValue(&cv_kartspeed, 1);
return;
}
if (G_RaceGametype())
{
if ((UINT8)cv_kartspeed.value != gamespeed && gamestate == GS_LEVEL && leveltime > starttime)