mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-09 17:23:51 +01:00
Use itemstack name when placing doors (#2888)
This commit is contained in:
parent
31f7d57889
commit
5875820542
@ -264,6 +264,7 @@ function doors.register(name, def)
|
|||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local doorname = itemstack:get_name()
|
||||||
local node = minetest.get_node(pointed_thing.under)
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
local pdef = minetest.registered_nodes[node.name]
|
local pdef = minetest.registered_nodes[node.name]
|
||||||
if pdef and pdef.on_rightclick and
|
if pdef and pdef.on_rightclick and
|
||||||
@ -315,10 +316,10 @@ function doors.register(name, def)
|
|||||||
local state = 0
|
local state = 0
|
||||||
if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then
|
if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then
|
||||||
state = state + 2
|
state = state + 2
|
||||||
minetest.set_node(pos, {name = name .. "_b", param2 = dir})
|
minetest.set_node(pos, {name = doorname .. "_b", param2 = dir})
|
||||||
minetest.set_node(above, {name = "doors:hidden", param2 = (dir + 3) % 4})
|
minetest.set_node(above, {name = "doors:hidden", param2 = (dir + 3) % 4})
|
||||||
else
|
else
|
||||||
minetest.set_node(pos, {name = name .. "_a", param2 = dir})
|
minetest.set_node(pos, {name = doorname .. "_a", param2 = dir})
|
||||||
minetest.set_node(above, {name = "doors:hidden", param2 = dir})
|
minetest.set_node(above, {name = "doors:hidden", param2 = dir})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user