From a734129eaedb74d9dafdf018acb3a25541f800b0 Mon Sep 17 00:00:00 2001 From: kaysrishaq <62462173+kaysrishaq@users.noreply.github.com> Date: Sun, 12 Jul 2020 10:07:32 -0400 Subject: [PATCH] lua_isboolean -> lua_toboolean solves bugged set field accessible --- src/lua_infolib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_infolib.c b/src/lua_infolib.c index e58b9d4ba..d0bad123a 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -1567,7 +1567,7 @@ static int lib_setSkinColor(lua_State *L) else if (i == 5 || (str && fastcmp(str,"chatcolor"))) info->chatcolor = (UINT16)luaL_checkinteger(L, 3); else if (i == 6 || (str && fastcmp(str,"accessible"))) - info->accessible = lua_isboolean(L,3) ? lua_toboolean(L, 3) : true; + info->accessible = (boolean)lua_toboolean(L, 3); lua_pop(L, 1); } return 0; @@ -1649,7 +1649,7 @@ static int skincolor_set(lua_State *L) else if (fastcmp(field,"chatcolor")) info->chatcolor = (UINT16)luaL_checkinteger(L, 3); else if (fastcmp(field,"accessible")) - info->accessible = lua_isboolean(L,3); + info->accessible = (boolean)lua_toboolean(L, 3); else CONS_Debug(DBG_LUA, M_GetText("'%s' has no field named '%s'; returning nil.\n"), "skincolor_t", field); return 1;