From 03b6c17f5163b27da6ffdbcfb492468ea880415b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 26 Jan 2018 19:54:48 +0100 Subject: [PATCH] Fix door closing if only 1 segment loses power --- mods/ITEMS/mcl_doors/api_doors.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_doors/api_doors.lua b/mods/ITEMS/mcl_doors/api_doors.lua index b32a58a581..8903eb5a63 100644 --- a/mods/ITEMS/mcl_doors/api_doors.lua +++ b/mods/ITEMS/mcl_doors/api_doors.lua @@ -207,13 +207,17 @@ function mcl_doors:register_door(name, def) on_open_close(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0}) end local function on_mesecons_signal_close(pos, node) - on_open_close(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2}) + if not mesecon.is_powered({x=pos.x,y=pos.y+1,z=pos.z}) then + on_open_close(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2}) + end end local function on_mesecons_signal_open_top(pos, node) on_mesecons_signal_open({x=pos.x, y=pos.y-1, z=pos.z}, node) end local function on_mesecons_signal_close_top(pos, node) - on_mesecons_signal_close({x=pos.x, y=pos.y-1, z=pos.z}, node) + if not mesecon.is_powered({x=pos.x,y=pos.y-1,z=pos.z}) then + on_mesecons_signal_close({x=pos.x, y=pos.y-1, z=pos.z}, node) + end end local function check_player_priv(pos, player)