mirror of
https://github.com/minetest-mods/mesecons.git
synced 2025-01-01 05:10:17 +01:00
mesecons_doors: Don't modify doors that are already mesecon-enabled
This commit is contained in:
parent
ff87cf3162
commit
ac83dead50
@ -22,6 +22,11 @@ end
|
|||||||
local function meseconify_door(name)
|
local function meseconify_door(name)
|
||||||
if minetest.registered_items[name .. "_b_1"] then
|
if minetest.registered_items[name .. "_b_1"] then
|
||||||
-- old style double-node doors
|
-- 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)
|
local function toggle_state1 (pos)
|
||||||
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
|
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
|
||||||
end
|
end
|
||||||
@ -47,6 +52,10 @@ local function meseconify_door(name)
|
|||||||
})
|
})
|
||||||
elseif minetest.registered_items[name .. "_a"] then
|
elseif minetest.registered_items[name .. "_a"] then
|
||||||
-- new style mesh node based doors
|
-- 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 = {
|
local override = {
|
||||||
mesecons = {effector = {
|
mesecons = {effector = {
|
||||||
action_on = function(pos)
|
action_on = function(pos)
|
||||||
|
Loading…
Reference in New Issue
Block a user