diff --git a/src/luaapi.c b/src/luaapi.c index 1b6f15f..1fc4b30 100644 --- a/src/luaapi.c +++ b/src/luaapi.c @@ -4392,7 +4392,11 @@ void luaapi_fillmaterial_direct(struct k3Mat *mat) { lua_pop(L, 1); lua_getfield(L, -1, "alphatest"); - mat->passes[0].alphatest = lua_toboolean(L, -1); + if(lua_type(L, -1) == LUA_TBOOLEAN) { + mat->passes[0].alphatest = lua_toboolean(L, -1); + } else { + mat->passes[0].alphatest = lua_tonumber(L, -1); + } lua_pop(L, 1); lua_getfield(L, -1, "depthwrite");