Skip to content

Commit

Permalink
Doors: Use LBM instead of ABM to convert doors.
Browse files Browse the repository at this point in the history
This works much more efficiently to replace old style doors.
  • Loading branch information
sofar authored and paramat committed Apr 19, 2016
1 parent 0ca43e4 commit 80664f9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mods/doors/init.lua
Expand Up @@ -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
Expand Down

0 comments on commit 80664f9

Please sign in to comment.