From 518e76d638bd74959cb8eb626e132f6377c3e386 Mon Sep 17 00:00:00 2001 From: Cam B Date: Wed, 20 Jan 2021 23:04:23 +0000 Subject: [PATCH] Tube walk function stops at an invalid secondary node --- internal2.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal2.lua b/internal2.lua index 821c408..1add69f 100644 --- a/internal2.lua +++ b/internal2.lua @@ -293,7 +293,7 @@ function Tube:determine_tube_dirs(pos, preferred_pos, fdir) if allowed[dir] then local _,npos,allow = self:get_secondary_node(pos, dir) if npos then - if not allow then + if allow == false then allowed[dir] = false else if preferred_pos and vector.equals(npos, preferred_pos) then @@ -416,6 +416,10 @@ function Tube:walk_tube_line(pos, dir) local cnt = 0 if dir then 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) if not new_pos then break end if cnt > 0 and num ~= 2 and self:is_primary_node(new_pos, new_dir) then