diff --git a/src/command.h b/src/command.h index 4486d829c..dc6d7ee46 100644 --- a/src/command.h +++ b/src/command.h @@ -140,6 +140,7 @@ typedef enum // used on menus CV_CHEAT = 2048, // Don't let this be used in multiplayer unless cheats are on. CV_NOLUA = 4096,/* don't let this be called from Lua */ + CV_ADDEDBYLUA = 8192, } cvflags_t; struct CV_PossibleValue_t diff --git a/src/deh_tables.c b/src/deh_tables.c index 0cccf3cdd..30e14b67c 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -6845,6 +6845,7 @@ struct int_const_s const INT_CONST[] = { {"CV_HIDDEN",CV_HIDDEN}, {"CV_CHEAT",CV_CHEAT}, {"CV_NOLUA",CV_NOLUA}, + {"CV_ADDEDBYLUA",CV_ADDEDBYLUA}, // v_video flags {"V_NOSCALEPATCH",V_NOSCALEPATCH}, diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index 965e9dd42..8a205fb51 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -411,7 +411,7 @@ static int lib_cvRegisterVar(lua_State *L) return luaL_error(L, M_GetText("Variable %s has CV_CALL without a function\n"), cvar->name); // actually time to register it to the console now! Finally! - cvar->flags |= CV_MODIFIED; + cvar->flags |= CV_MODIFIED | CV_ADDEDBYLUA; CV_RegisterVar(cvar); if (cvar->flags & CV_MODIFIED) return luaL_error(L, "failed to register cvar (probable conflict with internal variable/command names)"); diff --git a/src/menus/transient/pause-cheats.cpp b/src/menus/transient/pause-cheats.cpp index a12f3b235..7e0838fb5 100644 --- a/src/menus/transient/pause-cheats.cpp +++ b/src/menus/transient/pause-cheats.cpp @@ -64,7 +64,7 @@ void list_cvars() { for (consvar_t* var = consvar_vars; var; var = var->next) { - if (!(var->flags & CV_CHEAT)) + if (!(var->flags & (CV_CHEAT | CV_ADDEDBYLUA))) { continue; }