mesecons_doors: Don't modify doors that are already mesecon-enabled

This commit is contained in:
sfan5 2024-10-08 20:30:26 +02:00
parent ff87cf3162
commit ac83dead50

View File

@ -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
@ -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)