From 15e3d0e667f97dad191260d3b699e9d60a9f7174 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 15 Mar 2023 11:45:14 -0700 Subject: [PATCH] Fix toggle command and add command being able to bypass Lua restriction --- src/command.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/command.c b/src/command.c index e027b45f3..7ffa300b1 100644 --- a/src/command.c +++ b/src/command.c @@ -1000,6 +1000,9 @@ static void COM_Toggle_f(void) return; } + if (CV_Immutable(cvar)) + return; + if (!(cvar->PossibleValue == CV_YesNo || cvar->PossibleValue == CV_OnOff)) { CONS_Alert(CONS_NOTICE, M_GetText("%s is not a boolean value\n"), COM_Argv(1)); @@ -1029,6 +1032,9 @@ static void COM_Add_f(void) return; } + if (CV_Immutable(cvar)) + return; + if (( cvar->flags & CV_FLOAT )) { float n =FIXED_TO_FLOAT (cvar->value) + atof(COM_Argv(2));