diff options
author | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-18 11:32:16 +0100 |
---|---|---|
committer | thetaepsilon-gamedev <thetaepsilon-gamedev@noreply.users.github.com> | 2017-10-18 11:32:16 +0100 |
commit | 653aaffa3e56e0ac1dddd59f4604ca6e9b3fdcbe (patch) | |
tree | 2faa9f90377fa3bf0a9561cc68c50cd3ae405cfe | |
parent | 084bbc6c0b098235b6a402d04a3b57f69cede9ac (diff) | |
download | pipeworks-653aaffa3e56e0ac1dddd59f4604ca6e9b3fdcbe.tar pipeworks-653aaffa3e56e0ac1dddd59f4604ca6e9b3fdcbe.tar.gz pipeworks-653aaffa3e56e0ac1dddd59f4604ca6e9b3fdcbe.tar.bz2 pipeworks-653aaffa3e56e0ac1dddd59f4604ca6e9b3fdcbe.tar.xz pipeworks-653aaffa3e56e0ac1dddd59f4604ca6e9b3fdcbe.zip |
pressure logic/abms.lua: rename local variables and retain node data in connection check for-loop
-rw-r--r-- | pressure_logic/abms.lua | 9 |
1 files 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 |