Skip to content

Commit

Permalink
Merge pull request #10 from oversword/issue-9
Browse files Browse the repository at this point in the history
Fix side-injection (techpack#85; tubelib#9; bls#294) by checking both dirs for validity instead of assuming second dir will always be valid
  • Loading branch information
joe7575 authored Jun 7, 2021
2 parents bb15c12 + e44dd2e commit 5104e57
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 5104e57

Please sign in to comment.