Fix large chest to chest conversion

This commit is contained in:
Wuzzy 2017-01-12 22:40:02 +01:00
parent 027aaef235
commit 8354488e96

View File

@ -1439,7 +1439,7 @@ minetest.register_node("default:chest_left", {
end end
local param2 = n.param2 local param2 = n.param2
local p = get_chest_neighborpos(pos, param2, "left") local p = get_chest_neighborpos(pos, param2, "left")
if not p or n.name ~= "default:chest_right" then if not p or minetest.get_node(p).name ~= "default:chest_right" then
return return
end end
local meta = minetest.get_meta(p) local meta = minetest.get_meta(p)
@ -1452,7 +1452,7 @@ minetest.register_node("default:chest_left", {
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
"listring[current_name;main]".. "listring[current_name;main]"..
"listring[current_player;main]") "listring[current_player;main]")
minetest.swap_node(p, { name = "default:chest" }) minetest.swap_node(p, { name = "default:chest", param2 = param2 })
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
@ -1497,7 +1497,7 @@ minetest.register_node("default:chest_right", {
end end
local param2 = n.param2 local param2 = n.param2
local p = get_chest_neighborpos(pos, param2, "right") local p = get_chest_neighborpos(pos, param2, "right")
if not p or n.name ~= "default:chest_left" then if not p or minetest.get_node(p).name ~= "default:chest_left" then
return return
end end
local meta = minetest.get_meta(p) local meta = minetest.get_meta(p)
@ -1510,7 +1510,7 @@ minetest.register_node("default:chest_right", {
"list[current_player;main;0,7.74;9,1;]".. "list[current_player;main;0,7.74;9,1;]"..
"listring[current_name;main]".. "listring[current_name;main]"..
"listring[current_player;main]") "listring[current_player;main]")
minetest.swap_node(p, { name = "default:chest" }) minetest.swap_node(p, { name = "default:chest", param2 = param2 })
end, end,
after_dig_node = function(pos, oldnode, oldmetadata, digger) after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)