mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-12-29 17:17:29 +01:00
new flow logic: abms.lua: rename neighbour output helper to better indicate lack of rotation support
This commit is contained in:
parent
76ebd0a0e1
commit
8e53526b54
@ -377,7 +377,7 @@ minetest.register_node(nodename_spigot_loaded, {
|
|||||||
new_flow_logic_register.simple(nodename_spigot_empty)
|
new_flow_logic_register.simple(nodename_spigot_empty)
|
||||||
new_flow_logic_register.simple(nodename_spigot_loaded)
|
new_flow_logic_register.simple(nodename_spigot_loaded)
|
||||||
local spigot_min = 1
|
local spigot_min = 1
|
||||||
local outputfn = pipeworks.flowlogic.helpers.make_neighbour_output({{x=0, y=-1, z=0}})
|
local outputfn = pipeworks.flowlogic.helpers.make_neighbour_output_fixed({{x=0, y=-1, z=0}})
|
||||||
new_flow_logic_register.output(nodename_spigot_empty, spigot_min, outputfn)
|
new_flow_logic_register.output(nodename_spigot_empty, spigot_min, outputfn)
|
||||||
new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, outputfn)
|
new_flow_logic_register.output(nodename_spigot_loaded, spigot_min, outputfn)
|
||||||
|
|
||||||
@ -670,7 +670,7 @@ minetest.register_node(nodename_fountain_loaded, {
|
|||||||
new_flow_logic_register.simple(nodename_fountain_empty)
|
new_flow_logic_register.simple(nodename_fountain_empty)
|
||||||
new_flow_logic_register.simple(nodename_fountain_loaded)
|
new_flow_logic_register.simple(nodename_fountain_loaded)
|
||||||
local fountain_min = 1
|
local fountain_min = 1
|
||||||
local fountainfn = pipeworks.flowlogic.helpers.make_neighbour_output({{x=0, y=1, z=0}})
|
local fountainfn = pipeworks.flowlogic.helpers.make_neighbour_output_fixed({{x=0, y=1, z=0}})
|
||||||
new_flow_logic_register.output(nodename_fountain_empty, fountain_min, fountainfn)
|
new_flow_logic_register.output(nodename_fountain_empty, fountain_min, fountainfn)
|
||||||
new_flow_logic_register.output(nodename_fountain_loaded, fountain_min, fountainfn)
|
new_flow_logic_register.output(nodename_fountain_loaded, fountain_min, fountainfn)
|
||||||
|
|
||||||
|
@ -115,7 +115,8 @@ end
|
|||||||
-- outputs water by trying to place water nodes nearby in the world.
|
-- outputs water by trying to place water nodes nearby in the world.
|
||||||
-- neighbours is a list of node offsets to try placing water in.
|
-- neighbours is a list of node offsets to try placing water in.
|
||||||
-- this is a constructor function, returning another function which satisfies the output helper requirements.
|
-- this is a constructor function, returning another function which satisfies the output helper requirements.
|
||||||
flowlogic.helpers.make_neighbour_output = function(neighbours)
|
-- note that this does *not* take rotation into account.
|
||||||
|
flowlogic.helpers.make_neighbour_output_fixed = function(neighbours)
|
||||||
return function(pos, node, currentpressure)
|
return function(pos, node, currentpressure)
|
||||||
local taken = 0
|
local taken = 0
|
||||||
for _, offset in pairs(neighbours) do
|
for _, offset in pairs(neighbours) do
|
||||||
|
Loading…
Reference in New Issue
Block a user