Skip to content

Commit

Permalink
Use itemstack name when placing doors (#2888)
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Oct 31, 2021
1 parent 31f7d57 commit 5875820
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mods/doors/init.lua
Expand Up @@ -264,6 +264,7 @@ function doors.register(name, def)
return itemstack
end

local doorname = itemstack:get_name()
local node = minetest.get_node(pointed_thing.under)
local pdef = minetest.registered_nodes[node.name]
if pdef and pdef.on_rightclick and
Expand Down Expand Up @@ -315,10 +316,10 @@ function doors.register(name, def)
local state = 0
if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then
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})
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})
end

Expand Down

0 comments on commit 5875820

Please sign in to comment.