mirror of
https://github.com/joe7575/tubelib2.git
synced 2024-07-04 15:05:23 +02:00
Merge pull request #10 from oversword/issue-9
Fix side-injection (techpack#85; tubelib#9; bls#294) by checking both dirs for validity instead of assuming second dir will always be valid
This commit is contained in:
commit
5104e57420
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user