Prohibited setting of non-mod CVARs from unsafe alias

This commit is contained in:
alexey.lysiuk 2018-01-07 15:04:50 +02:00
parent f25a5ea2bc
commit 059e40e2d5

View file

@ -651,6 +651,12 @@ void C_DoCommand (const char *cmd, int keynum)
if (args.argc() >= 2) if (args.argc() >= 2)
{ // Set the variable { // Set the variable
if (UnsafeExecutionContext && !(var->GetFlags() & CVAR_MOD))
{
Printf(TEXTCOLOR_RED "Cannot set console variable" TEXTCOLOR_GOLD " %s " TEXTCOLOR_RED "from unsafe command\n", var->GetName());
return;
}
var->CmdSet (args[1]); var->CmdSet (args[1]);
} }
else else