Don't add string cvars (a bit hacky solution)

This commit is contained in:
indev authored and Alug committed 2024-03-04 21:08:05 +01:00
1 parent c266151071
commit 81e3810c32
1 file changed
+2 -2
+2 -2
View File
@@ -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;
}
}