1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 23:10:17 +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
-- 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"},
interval = 7.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
action = function(pos, node)
local l = tonumber(node.name:sub(-1))
local meta = minetest.get_meta(pos)
local h = meta:get_int("right") + 1