Partial implementation of rails on slopes

master
Wuzzy 2017-05-10 19:53:40 +02:00
parent 41727c57f4
commit 1aa8598c2a
1 changed files with 14 additions and 16 deletions

View File

@ -366,10 +366,9 @@ local function corridor_func(waypoint, coord, sign, up_or_down, up, wood, post,
segcount = segcount * 3
end
local chestplace = -1
if pr:next() < probability_chest then
if not up_or_down and pr:next() < probability_chest then
chestplace = pr:next(1,segcount+1)
end
if not up_or_down then
for i=1,segcount do
local p = {x=waypoint.x+vek.x*i, y=waypoint.y+vek.y*i-1, z=waypoint.z+vek.z*i}
if minetest.get_node({x=p.x,y=p.y-1,z=p.z}).name=="air" and minetest.get_node({x=p.x,y=p.y-3,z=p.z}).name~="default:rail" then
@ -386,7 +385,6 @@ local function corridor_func(waypoint, coord, sign, up_or_down, up, wood, post,
end
end
end
end
return {x=waypoint.x+corridor_vek.x, y=waypoint.y+corridor_vek.y, z=waypoint.z+corridor_vek.z}
end