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:".
master
Thomas--S 2016-07-17 18:52:42 +02:00 committed by paramat
parent 3661cb61e3
commit 9862bbc8e5
1 changed files with 4 additions and 0 deletions

View File

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