Don't go vertical if waypoint needs platform

master
Wuzzy 2019-02-14 17:16:11 +01:00
parent aa9eb9e76f
commit 4d765c00aa
1 changed files with 3 additions and 6 deletions

View File

@ -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