Skip to content

Commit

Permalink
mesecons_doors: Don't modify doors that are already mesecon-enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Oct 8, 2024
1 parent ff87cf3 commit ac83dea
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mesecons_doors/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ end
local function meseconify_door(name)
if minetest.registered_items[name .. "_b_1"] then
-- old style double-node doors
if minetest.registered_items[name .. "_b_1"].mesecons then
minetest.log("info", "[mesecons_doors] Not touching door " .. name)
return
end

local function toggle_state1 (pos)
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
end
Expand All @@ -47,6 +52,10 @@ local function meseconify_door(name)
})
elseif minetest.registered_items[name .. "_a"] then
-- new style mesh node based doors
if minetest.registered_items[name .. "_a"].mesecons then
minetest.log("info", "[mesecons_doors] Not touching door " .. name)
return
end
local override = {
mesecons = {effector = {
action_on = function(pos)
Expand Down

0 comments on commit ac83dea

Please sign in to comment.