Fix toggle command and add command being able to bypass Lua restriction

This commit is contained in:
James R 2023-03-15 11:45:14 -07:00
parent 5d08bfd706
commit 15e3d0e667

View file

@ -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));