mirror of
https://github.com/mt-mods/pipeworks.git
synced 2024-12-26 19:00:24 +01:00
pressure logic/abms.lua: rename local variables and retain node data in connection check for-loop
This commit is contained in:
parent
084bbc6c0b
commit
653aaffa3e
@ -154,14 +154,15 @@ local get_neighbour_positions = function(pos, node)
|
|||||||
local connections = {}
|
local connections = {}
|
||||||
for index, offset in ipairs(candidates) do
|
for index, offset in ipairs(candidates) do
|
||||||
local npos = vector.add(pos, offset)
|
local npos = vector.add(pos, offset)
|
||||||
local nodename = minetest.get_node(npos).name
|
local neighbour = minetest.get_node(npos)
|
||||||
|
local nodename = neighbour.name
|
||||||
local is_simple = (pipeworks.flowables.list.simple[nodename])
|
local is_simple = (pipeworks.flowables.list.simple[nodename])
|
||||||
if is_simple then
|
if is_simple then
|
||||||
local neighbour = get_pressure_access(npos)
|
local n = get_pressure_access(npos)
|
||||||
table.insert(connections, neighbour)
|
table.insert(connections, n)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return connections
|
return connections
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user