From b2b29a1737c4bd86e397bb496d06aebd8129def7 Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Thu, 19 Oct 2017 13:35:31 +0100 Subject: pressure logic: rewrite callbacks for horizontal rotation flowables to support singular and double-ended devices --- devices.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index 093137e..cb1a6d1 100644 --- a/devices.lua +++ b/devices.lua @@ -215,7 +215,7 @@ for s in ipairs(states) do -- only register flow logic for the "on" ABM. -- this means that the off state automatically blocks flow by not participating in the balancing operation. if states[s] ~= "off" then - new_flow_logic_register.directional_horizonal_rotate(nodename_valve_empty) + new_flow_logic_register.directional_horizonal_rotate(nodename_valve_empty, true) end end @@ -263,7 +263,7 @@ minetest.register_node(nodename_valve_loaded, { -- right-clicking a "loaded" valve (becoming an off valve) then turning it on again will yield a on-but-empty valve, -- but the flow logic will still function. -- thus under new_flow_logic this serves as a kind of migration. -new_flow_logic_register.directional_horizonal_rotate(nodename_valve_loaded) +new_flow_logic_register.directional_horizonal_rotate(nodename_valve_loaded, true) -- grating @@ -438,8 +438,8 @@ minetest.register_node(nodename_panel_loaded, { on_rotate = pipeworks.fix_after_rotation }) -- TODO: AFAIK the two panels have no visual difference, so are redundant under new flow logic - alias? -new_flow_logic_register.directional_horizonal_rotate(nodename_panel_empty) -new_flow_logic_register.directional_horizonal_rotate(nodename_panel_loaded) +new_flow_logic_register.directional_horizonal_rotate(nodename_panel_empty, true) +new_flow_logic_register.directional_horizonal_rotate(nodename_panel_loaded, true) @@ -521,8 +521,8 @@ minetest.register_node(nodename_sensor_loaded, { mesecons = pipereceptor_on, on_rotate = pipeworks.fix_after_rotation }) -new_flow_logic_register.directional_horizonal_rotate(nodename_sensor_empty) -new_flow_logic_register.directional_horizonal_rotate(nodename_sensor_loaded) +new_flow_logic_register.directional_horizonal_rotate(nodename_sensor_empty, true) +new_flow_logic_register.directional_horizonal_rotate(nodename_sensor_loaded, true) -- activate flow sensor at roughly half the pressure pumps drive pipes local sensor_pressure_set = { { nodename_sensor_empty, 0.0 }, { nodename_sensor_loaded, 1.0 } } new_flow_logic_register.transition_simple_set(sensor_pressure_set, { mesecons=pipeworks.mesecons_rules }) -- cgit v1.2.3 From b7714df9549be36920b1940f6dd2f627c36f160b Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Thu, 19 Oct 2017 13:41:37 +0100 Subject: devices.lua: convert spigot to single-ended horizontally rotating flowable --- devices.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'devices.lua') diff --git a/devices.lua b/devices.lua index cb1a6d1..3ccbd09 100644 --- a/devices.lua +++ b/devices.lua @@ -376,8 +376,8 @@ minetest.register_node(nodename_spigot_loaded, { }) -- new flow logic does not currently distinguish between these two visual states. -- register both so existing flowing spigots continue to work (even if the visual doesn't match the spigot's behaviour). -new_flow_logic_register.simple(nodename_spigot_empty) -new_flow_logic_register.simple(nodename_spigot_loaded) +new_flow_logic_register.directional_horizonal_rotate(nodename_spigot_empty, false) +new_flow_logic_register.directional_horizonal_rotate(nodename_spigot_loaded, false) local spigot_upper = 1.0 local spigot_lower = 1.0 local spigot_neighbours={{x=0, y=-1, z=0}} -- cgit v1.2.3