Merge branch 'nolua-alias' into 'next'

Fix console aliases bypassing CV_NOLUA

Closes #619

See merge request STJr/SRB2!1573
This commit is contained in:
sphere 2021-08-02 13:09:12 +00:00
commit ab044a270b
2 changed files with 6 additions and 3 deletions

View file

@ -650,7 +650,7 @@ static void COM_ExecuteString(char *ptext)
else
{ // Monster Iestyn: keep track of how many levels of recursion we're in
recursion++;
COM_BufInsertText(a->value);
COM_BufInsertTextEx(a->value, com_flags);
recursion--;
}
return;
@ -2366,7 +2366,10 @@ static boolean CV_Command(void)
return false;
if (( com_flags & COM_SAFE ) && ( v->flags & CV_NOLUA ))
return false;
{
CONS_Alert(CONS_WARNING, "Variable '%s' cannot be changed from Lua.\n", v->name);
return true;
}
// perform a variable print or set
if (COM_Argc() == 1)

View file

@ -433,7 +433,7 @@ static int CVarSetFunction
consvar_t *cvar = *(consvar_t **)luaL_checkudata(L, 1, META_CVAR);
if (cvar->flags & CV_NOLUA)
return luaL_error(L, "Variable %s cannot be set from Lua.", cvar->name);
return luaL_error(L, "Variable '%s' cannot be set from Lua.", cvar->name);
switch (lua_type(L, 2))
{