From ea564dd28492e1b9f3e5f06e17e7ffde612ed12d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 11 Jun 2017 21:56:30 +0200 Subject: [PATCH] Fix weird armor slot exchange logic (a bit) --- mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua b/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua index c3989e6e7b..b765820535 100644 --- a/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua +++ b/mods/ITEMS/minetest-3d_armor/3d_armor/armor.lua @@ -337,7 +337,9 @@ minetest.register_on_joinplayer(function(player) elseif index == 5 then g = minetest.get_item_group(iname, "armor_feet") end - if g ~= 0 and g ~= nil and inv:get_stack(listname, index):is_empty() then + -- Minor FIXME: If player attempts to place stack into occupied slot, this is rejected. + -- It would be better if 1 item is placed in exchanged for the item in the slot. + if g ~= 0 and g ~= nil and (inv:get_stack(listname, index):is_empty() or (inv:get_stack(listname, index):get_name() ~= stack:get_name()) and stack:get_count() <= 1) then return 1 else return 0