From 4144fb84b0385286fa94b8d086f1ddc9753b8e0e Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 3 Feb 2015 02:55:46 -0500 Subject: [PATCH] if someone screwdrivers a valve or sensor out of horizontal, reset it back to horizontal --- flowing_logic.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flowing_logic.lua b/flowing_logic.lua index dce7bc4..009f7c0 100644 --- a/flowing_logic.lua +++ b/flowing_logic.lua @@ -208,9 +208,14 @@ minetest.register_abm({ chance = 1, action = function(pos, node, active_object_count, active_object_count_wider) local fdir = node.param2 + local axisdir = math.floor(fdir/4) local fdir_mod4 = fdir % 4 local fdir_mod4_p2 = (fdir+2) % 4 + if axisdir ~= 0 and axisdir ~= 5 then -- if it isn't horizontal, force it. + minetest.swap_node(pos, {name = node.name, param2 = fdir_mod4}) + end + local fdir_to_pos = { {x = pos.x+1, y = pos.y, z = pos.z }, {x = pos.x, y = pos.y, z = pos.z-1},