From bbb0c53616d789a311fcf5d4d85a2503aaf67b96 Mon Sep 17 00:00:00 2001 From: Indev Date: Mon, 4 Mar 2024 23:07:42 +0300 Subject: [PATCH] Don't add string cvars (a bit hacky solution) --- src/lua_consolelib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_consolelib.c b/src/lua_consolelib.c index e52313cea..7d9cd67ec 100644 --- a/src/lua_consolelib.c +++ b/src/lua_consolelib.c @@ -451,7 +451,7 @@ static int lib_cvRegisterVar(lua_State *L) if (cvar->flags & CV_MODIFIED) return luaL_error(L, "failed to register cvar (probable conflict with internal variable/command names)"); - if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP))) + if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP)) && (cvar->PossibleValue || !(cvar->value == 0 && stricmp(cvar->string, "0")))) { if (!category) { @@ -637,4 +637,4 @@ int LUA_ConsoleLib(lua_State *L) lua_pushvalue(L, LUA_GLOBALSINDEX); luaL_register(L, NULL, lib); return 0; -} \ No newline at end of file +}