1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-23 07:10:19 +01:00

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

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