Doors: Same naming for trapdoors as for doors

This makes register_trapdoor act the same as the register_door.
If `name` isn't prefixed, it will be prefixed with "doors:".
This commit is contained in:
Thomas--S 2016-07-17 18:52:42 +02:00 committed by paramat
parent 3661cb61e3
commit 9862bbc8e5

View File

@ -533,6 +533,10 @@ function _doors.trapdoor_toggle(pos, node, clicker)
end end
function doors.register_trapdoor(name, def) function doors.register_trapdoor(name, def)
if not name:find(":") then
name = "doors:" .. name
end
local name_closed = name local name_closed = name
local name_opened = name.."_open" local name_opened = name.."_open"