Skip to content

Commit

Permalink
Fix side-injection (techpack#85; tubelib#9; bls#294) by checking both…
Browse files Browse the repository at this point in the history
… dirs for validity instead of assuming second dir will always be valid
  • Loading branch information
Oversword committed Jun 6, 2021
1 parent bb15c12 commit e44dd2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,13 @@ function Tube:get_next_tube(pos, dir)
local val = Param2ToDir[param2 % 32] or 0
local dir1, dir2 = math.floor(val / 10), val % 10
local num_conn = math.floor(param2 / 32) or 0
if Turn180Deg[dir] == dir1 then
local odir = Turn180Deg[dir]
if odir == dir1 then
return npos, dir2, num_conn
else
elseif odir == dir2 then
return npos, dir1, num_conn
end
return
end
return self:get_next_teleport_node(pos, dir)
end
Expand Down

0 comments on commit e44dd2e

Please sign in to comment.