From 653aaffa3e56e0ac1dddd59f4604ca6e9b3fdcbe Mon Sep 17 00:00:00 2001 From: thetaepsilon-gamedev Date: Wed, 18 Oct 2017 11:32:16 +0100 Subject: [PATCH] pressure logic/abms.lua: rename local variables and retain node data in connection check for-loop --- pressure_logic/abms.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pressure_logic/abms.lua b/pressure_logic/abms.lua index bed96b8..16bdb2d 100644 --- a/pressure_logic/abms.lua +++ b/pressure_logic/abms.lua @@ -154,14 +154,15 @@ local get_neighbour_positions = function(pos, node) local connections = {} for index, offset in ipairs(candidates) do 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]) if is_simple then - local neighbour = get_pressure_access(npos) - table.insert(connections, neighbour) + local n = get_pressure_access(npos) + table.insert(connections, n) end end - + return connections end