forked from minetest-mods/mesecons
Fix #219, do not try to override unregistered doors
This commit is contained in:
parent
14281a1bd4
commit
8bf5b7d0e4
@ -20,6 +20,8 @@ local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
|
||||
end
|
||||
|
||||
local function meseconify_door(name)
|
||||
if not minetest.registered_items[name] then return end
|
||||
|
||||
local function toggle_state1 (pos, node)
|
||||
on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
|
||||
end
|
||||
@ -65,6 +67,7 @@ local function trapdoor_switch(pos, node)
|
||||
minetest.get_meta(pos):set_int("state", state == 1 and 0 or 1)
|
||||
end
|
||||
|
||||
if minetest.registered_nodes["doors:trapdoor"] then
|
||||
minetest.override_item("doors:trapdoor", {
|
||||
mesecons = {effector = {
|
||||
action_on = trapdoor_switch,
|
||||
@ -78,3 +81,4 @@ minetest.override_item("doors:trapdoor_open", {
|
||||
action_off = trapdoor_switch
|
||||
}},
|
||||
})
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user