summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthetaepsilon-gamedev <32034735+thetaepsilon-gamedev@users.noreply.github.com>2017-12-25 19:48:21 +0000
committerGitHub <noreply@github.com>2017-12-25 19:48:21 +0000
commitcb692d21881541df2fca011ecdfbc43c127787ea (patch)
tree0c4b0058bc020d9661e980def73225da49d7d01c
parent91bd0c7e985c6d5f98fddd22dccb6a4d30cae86f (diff)
parent83c3030494913d86e6d5f9614bba77fe663b2301 (diff)
downloadpipeworks-cb692d21881541df2fca011ecdfbc43c127787ea.tar
pipeworks-cb692d21881541df2fca011ecdfbc43c127787ea.tar.gz
pipeworks-cb692d21881541df2fca011ecdfbc43c127787ea.tar.bz2
pipeworks-cb692d21881541df2fca011ecdfbc43c127787ea.tar.xz
pipeworks-cb692d21881541df2fca011ecdfbc43c127787ea.zip
Merge pull request #209 from h-v-smacker/luatube_pin_report
Explicitly report the color of incoming port for items coming through tubes
-rw-r--r--lua_tube.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/lua_tube.lua b/lua_tube.lua
index 51665ae..8cc4468 100644
--- a/lua_tube.lua
+++ b/lua_tube.lua
@@ -731,8 +731,17 @@ for white = 0, 1 do
connect_sides = {front = 1, back = 1, left = 1, right = 1, top = 1, bottom = 1},
priority = 50,
can_go = function(pos, node, velocity, stack)
+ local src = {name = nil}
+ -- add color of the incoming tube explicitly; referring to rules, in case they change later
+ for color, rule in pairs(rules) do
+ if (-velocity.x == rule.x and -velocity.y == rule.y and -velocity.z == rule.z) then
+ src.name = rule.name
+ break
+ end
+ end
local succ, msg = run(pos, {
type = "item",
+ pin = src,
itemstring = stack:to_string(),
item = stack:to_table(),
velocity = velocity,