From 4d765c00aa2761433de0c0bb7a373f72255dfee3 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 14 Feb 2019 17:16:11 +0100 Subject: [PATCH] Don't go vertical if waypoint needs platform --- init.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index 70dc7c4..d020f2d 100644 --- a/init.lua +++ b/init.lua @@ -842,15 +842,12 @@ local function create_corridor_line(waypoint, axis, sign, length, wood, post, da local up = false -- true if going up local upp = false -- true if was going up previously for i=1,length do - local needs_platform -- Update previous up/down status udp = ud + -- Can't go up/down if a platform is needed at waypoint + local needs_platform = NeedsPlatform({x=wp.x,y=wp.y-2,z=wp.z}) -- Update current up/down status - if udn then - needs_platform = NeedsPlatform(wp) - if needs_platform then - ud = false - end + if udn and not needs_platform then ud = true -- Force direction near the height limits if wp.y >= height_max - 12 then