aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2016-01-15 13:40:59 +0100
committersfan5 <sfan5@live.de>2016-01-15 13:44:45 +0100
commita58c0f458d336fdab59737c754661e4f16818d99 (patch)
treee512aefd5bcca20dc62fc02738e8e8ddadc44235 /src/script/lua_api
parentda686160c33069b77a7b4c31fd97da5fa5b59baa (diff)
downloadminetest-a58c0f458d336fdab59737c754661e4f16818d99.tar.gz
minetest-a58c0f458d336fdab59737c754661e4f16818d99.tar.bz2
minetest-a58c0f458d336fdab59737c754661e4f16818d99.zip
Make ItemStack:set_count(0) clear the item stack
fixes minetest/minetest_game#786
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_item.cpp2
1 files changed, 1 insertions, 1 deletions
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 {