1
0
mirror of https://github.com/D00Med/scifi_nodes.git synced 2024-12-22 16:10:18 +01:00

Merge pull request #13 from coil0/duplication

Fix duplication with item holder and powered stand
This commit is contained in:
D00Med 2019-07-02 16:05:02 +10:00 committed by GitHub
commit 1cf50f0ad5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -606,8 +606,11 @@ minetest.register_node("scifi_nodes:powered_stand", {
groups = {cracky=1, oddly_breakable_by_hand=1},
on_rightclick = function(pos, node, clicker, item, _)
local wield_item = clicker:get_wielded_item():get_name()
item:take_item()
local taken = item:take_item()
if taken and not taken:is_empty() then
minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, wield_item)
return item
end
end,
})
@ -1067,8 +1070,11 @@ minetest.register_node("scifi_nodes:itemholder", {
if name == meta:get_string("owner") or
minetest.check_player_privs(name, "protection_bypass") then
local wield_item = clicker:get_wielded_item():get_name()
item:take_item()
local taken = item:take_item()
if taken and not taken:is_empty() then
minetest.add_item(pos, wield_item)
return item
end
end
end,
can_dig = function(pos,player)