Don't go vertical if waypoint needs platform
parent
aa9eb9e76f
commit
4d765c00aa
9
init.lua
9
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 up = false -- true if going up
|
||||||
local upp = false -- true if was going up previously
|
local upp = false -- true if was going up previously
|
||||||
for i=1,length do
|
for i=1,length do
|
||||||
local needs_platform
|
|
||||||
-- Update previous up/down status
|
-- Update previous up/down status
|
||||||
udp = ud
|
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
|
-- Update current up/down status
|
||||||
if udn then
|
if udn and not needs_platform then
|
||||||
needs_platform = NeedsPlatform(wp)
|
|
||||||
if needs_platform then
|
|
||||||
ud = false
|
|
||||||
end
|
|
||||||
ud = true
|
ud = true
|
||||||
-- Force direction near the height limits
|
-- Force direction near the height limits
|
||||||
if wp.y >= height_max - 12 then
|
if wp.y >= height_max - 12 then
|
||||||
|
|
Loading…
Reference in New Issue