mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Make ItemStack:set_count(0) clear the item stack
fixes minetest/minetest_game#786
This commit is contained in:
@@ -94,7 +94,7 @@ int LuaItemStack::l_set_count(lua_State *L)
|
|||||||
|
|
||||||
bool status;
|
bool status;
|
||||||
lua_Integer count = luaL_checkinteger(L, 2);
|
lua_Integer count = luaL_checkinteger(L, 2);
|
||||||
if (count <= 65535) {
|
if (count > 0 && count <= 65535) {
|
||||||
item.count = count;
|
item.count = count;
|
||||||
status = true;
|
status = true;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user