Disable chaining of two vertical corridors
parent
681dc026b5
commit
6431a7b906
10
init.lua
10
init.lua
|
@ -402,12 +402,12 @@ local function start_corridor(waypoint, coord, sign, length, psra, wood, post)
|
||||||
local wp = waypoint
|
local wp = waypoint
|
||||||
local c = coord
|
local c = coord
|
||||||
local s = sign
|
local s = sign
|
||||||
local ud
|
local ud = false -- up or down
|
||||||
local up
|
local up
|
||||||
for i=1,length do
|
for i=1,length do
|
||||||
-- Nach oben oder nach unten?
|
-- Up or down?
|
||||||
--Up or down?
|
-- ud is also checked to prevent chaining up/down segments
|
||||||
if pr:next() < probability_up_or_down and i~=1 then
|
if pr:next() < probability_up_or_down and i~=1 and not ud then
|
||||||
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
|
||||||
|
@ -419,7 +419,7 @@ local function start_corridor(waypoint, coord, sign, length, psra, wood, post)
|
||||||
up = pr:next(0, 2) < 1
|
up = pr:next(0, 2) < 1
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ud = false
|
ud = false
|
||||||
end
|
end
|
||||||
-- Make corridor / Korridor graben
|
-- Make corridor / Korridor graben
|
||||||
wp = corridor_func(wp,c,s, ud, up, wood, post, i == length)
|
wp = corridor_func(wp,c,s, ud, up, wood, post, i == length)
|
||||||
|
|
Loading…
Reference in New Issue