Skip to content
Snippets Groups Projects
Commit 15e3d0e6 authored by James R.'s avatar James R.
Browse files

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

parent 5d08bfd7
Branches
Tags
1 merge request!1943Fix up Lua command/cvar safety
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment