mirror of
https://github.com/joe7575/tubelib2.git
synced 2024-10-05 17:33:11 +02:00
Tube walk function stops at an invalid secondary node
This commit is contained in:
parent
5232d1a3af
commit
518e76d638
@ -293,7 +293,7 @@ function Tube:determine_tube_dirs(pos, preferred_pos, fdir)
|
|||||||
if allowed[dir] then
|
if allowed[dir] then
|
||||||
local _,npos,allow = self:get_secondary_node(pos, dir)
|
local _,npos,allow = self:get_secondary_node(pos, dir)
|
||||||
if npos then
|
if npos then
|
||||||
if not allow then
|
if allow == false then
|
||||||
allowed[dir] = false
|
allowed[dir] = false
|
||||||
else
|
else
|
||||||
if preferred_pos and vector.equals(npos, preferred_pos) then
|
if preferred_pos and vector.equals(npos, preferred_pos) then
|
||||||
@ -416,6 +416,10 @@ function Tube:walk_tube_line(pos, dir)
|
|||||||
local cnt = 0
|
local cnt = 0
|
||||||
if dir then
|
if dir then
|
||||||
while cnt <= self.max_tube_length do
|
while cnt <= self.max_tube_length do
|
||||||
|
local secondary,_,valid = self:get_secondary_node(pos, dir)
|
||||||
|
if secondary and valid == false then
|
||||||
|
break
|
||||||
|
end
|
||||||
local new_pos, new_dir, num = self:get_next_tube(pos, dir)
|
local new_pos, new_dir, num = self:get_next_tube(pos, dir)
|
||||||
if not new_pos then break end
|
if not new_pos then break end
|
||||||
if cnt > 0 and num ~= 2 and self:is_primary_node(new_pos, new_dir) then
|
if cnt > 0 and num ~= 2 and self:is_primary_node(new_pos, new_dir) then
|
||||||
|
Loading…
Reference in New Issue
Block a user