From: sfan5 Date: Fri, 15 Jan 2016 12:40:59 +0000 (+0100) Subject: Make ItemStack:set_count(0) clear the item stack X-Git-Tag: 0.4.14~324 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a58c0f458d336fdab59737c754661e4f16818d99;p=oweals%2Fminetest.git Make ItemStack:set_count(0) clear the item stack fixes minetest/minetest_game#786 --- diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp index 842b15709..5381cba76 100644 --- a/src/script/lua_api/l_item.cpp +++ b/src/script/lua_api/l_item.cpp @@ -94,7 +94,7 @@ int LuaItemStack::l_set_count(lua_State *L) bool status; lua_Integer count = luaL_checkinteger(L, 2); - if (count <= 65535) { + if (count > 0 && count <= 65535) { item.count = count; status = true; } else {