Doors: Same naming for trapdoors as for doors
authorThomas--S <Thomas--S@users.noreply.github.com>
Sun, 17 Jul 2016 16:52:42 +0000 (18:52 +0200)
committerparamat <mat.gregory@virginmedia.com>
Mon, 18 Jul 2016 22:43:51 +0000 (23:43 +0100)
This makes register_trapdoor act the same as the register_door.
If `name` isn't prefixed, it will be prefixed with "doors:".

mods/doors/init.lua

index 0d3fd23f09f18dba6dc1c4124a9b2412d8d81f9e..914e385f37409b8b505651cf04c96fde677e2c4f 100644 (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"