Skip to content

Commit

Permalink
Improve pipe/tube placement
Browse files Browse the repository at this point in the history
  • Loading branch information
joe7575 committed Nov 26, 2023
1 parent 21582d0 commit 030a588
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,16 @@ function Tube:determine_tube_dirs(pos, preferred_pos, fdir)
(self:connected(pos, tbl[2]) and 1 or 0)
return tbl[1], tbl[2], math.min(2, num_tubes)
end

-- dir1, dir2 still unknown?
if fdir and #tbl < 2 then
-- Try to turn the node by 90 degrees
local dir1 = fdir < 5 and (fdir + 1) % 4 or fdir
local dir2 = dir1 < 5 and Turn180Deg[dir1] or dir1
if dir1 ~= dir2 and allowed[dir1] and allowed[dir2] then
return dir1, dir2, 0
end
end
end

-- Determine a tube side without connection, increment the number of connections
Expand Down

0 comments on commit 030a588

Please sign in to comment.