Fix door closing if only 1 segment loses power

This commit is contained in:
Wuzzy 2018-01-26 19:54:48 +01:00
parent c2d0414255
commit 03b6c17f51

View File

@ -207,14 +207,18 @@ 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}) on_open_close(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0})
end end
local function on_mesecons_signal_close(pos, node) local function on_mesecons_signal_close(pos, node)
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}) on_open_close(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2})
end end
end
local function on_mesecons_signal_open_top(pos, node) local function on_mesecons_signal_open_top(pos, node)
on_mesecons_signal_open({x=pos.x, y=pos.y-1, z=pos.z}, node) on_mesecons_signal_open({x=pos.x, y=pos.y-1, z=pos.z}, node)
end end
local function on_mesecons_signal_close_top(pos, node) local function on_mesecons_signal_close_top(pos, 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) on_mesecons_signal_close({x=pos.x, y=pos.y-1, z=pos.z}, node)
end end
end
local function check_player_priv(pos, player) local function check_player_priv(pos, player)
if not def.only_placer_can_open then if not def.only_placer_can_open then