From: PilzAdam Date: Sat, 6 Dec 2014 10:43:07 +0000 (+0100) Subject: Fix possible stacking of books in bookshelf X-Git-Tag: 0.4.11~23 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fd34872de8ae7ecc449896a0dad5e77aad4a664e;p=oweals%2Fminetest_game.git Fix possible stacking of books in bookshelf Original author: @MT-Modder --- diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 84f5f947..3fe0fe80 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -407,8 +407,9 @@ minetest.register_node("default:bookshelf", { allow_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() + local to_stack = inv:get_stack(listname, index) if listname == "books" then - if stack:get_name() == "default:book" then + if stack:get_name() == "default:book" and to_stack:is_empty() then return 1 else return 0