Doors: Use LBM instead of ABM to convert doors.

This works much more efficiently to replace old style doors.
This commit is contained in:
Auke Kok 2016-04-15 20:55:56 -07:00 committed by paramat
parent 0ca43e42bc
commit 80664f9f8a
1 changed files with 3 additions and 4 deletions

View File

@ -203,11 +203,10 @@ function doors.register(name, def)
end end
-- replace old doors of this type automatically -- replace old doors of this type automatically
minetest.register_abm({ minetest.register_lbm({
name = ":doors:replace_" .. name:gsub(":", "_"),
nodenames = {name.."_b_1", name.."_b_2"}, nodenames = {name.."_b_1", name.."_b_2"},
interval = 7.0, action = function(pos, node)
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local l = tonumber(node.name:sub(-1)) local l = tonumber(node.name:sub(-1))
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local h = meta:get_int("right") + 1 local h = meta:get_int("right") + 1