From b6b19c82508b9ce06e6a2b2d28e6431d02af0bb2 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Tue, 30 Oct 2018 23:08:58 +0100 Subject: [PATCH] Removed some useless stuff --- src/lua_hudlib.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 5182a40a..e12eb2d8 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -574,7 +574,7 @@ static int libd_renderer(lua_State *L) return 1; } -// Lat': Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int +// Lat': Get cv_translucenthud's value for HUD rendering as a normal V_xxTRANS int instead of V_HUDTRANS. This is useful if we want to work from that transparency value // Could as well be thrown in global vars for ease of access but I guess it makes sense for it to be a HUD fn static int libd_getlocaltransflag(lua_State *L) { @@ -625,11 +625,10 @@ static int lib_huddisable(lua_State *L) } // 30/10/18: Lat': Why the FUCK is this NOT in vanilla -static int LUA_IsHUDEnabled(lua_State *L) +static int lib_hudenabled(lua_State *L) { enum hud option = luaL_checkoption(L, 1, NULL, hud_disable_options); - lua_settop(L, 2); - if (!gL || hud_enabled[option/8] & (1<<(option%8))) + if (hud_enabled[option/8] & (1<<(option%8))) lua_pushboolean(L, true); else lua_pushboolean(L, false); @@ -661,7 +660,7 @@ static int lib_hudadd(lua_State *L) static luaL_Reg lib_hud[] = { {"enable", lib_hudenable}, {"disable", lib_huddisable}, - {"enabled", LUA_IsHUDEnabled}, + {"enabled", LUA_hudenabled}, {"add", lib_hudadd}, {NULL, NULL} };