different curvature, set param2s

This commit is contained in:
FaceDeer 2017-03-15 15:35:00 -06:00
parent 80f736e482
commit 48f89c33c8

View File

@ -107,7 +107,7 @@ local tunnel_tube_directions = {
{x=0,y=0,z=-1}, {x=0,y=0,z=-1},
} }
local tunnel_tube_curvature = {0,0,0,1,1,1,2,2,3,4} local tunnel_tube_curvature = {0,0,0,0,1,1,1,2,2,3,4}
dfcaverns.spawn_tunnel_tube = function(pos) dfcaverns.spawn_tunnel_tube = function(pos)
local direction = tunnel_tube_directions[math.random(1,4)] local direction = tunnel_tube_directions[math.random(1,4)]
@ -120,10 +120,12 @@ dfcaverns.spawn_tunnel_tube = function(pos)
local minp, maxp = vm:read_from_map(pos, top_pos) local minp, maxp = vm:read_from_map(pos, top_pos)
local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
local data = vm:get_data() local data = vm:get_data()
local param2_data = vm:get_param2_data()
dfcaverns.spawn_tunnel_tube_vm(area:indexp(pos), area, data, height, direction) dfcaverns.spawn_tunnel_tube_vm(area:indexp(pos), area, data, param2_data, height, direction)
vm:set_data(data) vm:set_data(data)
vm:set_param2_data(param2_data)
vm:write_to_map() vm:write_to_map()
vm:update_map() vm:update_map()
end end
@ -133,7 +135,7 @@ local c_ignore = minetest.get_content_id("ignore")
local c_tunnel_tube = minetest.get_content_id("dfcaverns:tunnel_tube") local c_tunnel_tube = minetest.get_content_id("dfcaverns:tunnel_tube")
local c_tunnel_tube_fruiting_body = minetest.get_content_id("dfcaverns:tunnel_tube_fruiting_body") local c_tunnel_tube_fruiting_body = minetest.get_content_id("dfcaverns:tunnel_tube_fruiting_body")
dfcaverns.spawn_tunnel_tube_vm = function(vi, area, data, height, direction) dfcaverns.spawn_tunnel_tube_vm = function(vi, area, data, param2_data, height, direction)
if not height then height = math.random(6, 10) end if not height then height = math.random(6, 10) end
if not direction then direction = tunnel_tube_directions[math.random(1,4)] end if not direction then direction = tunnel_tube_directions[math.random(1,4)] end
@ -147,6 +149,7 @@ dfcaverns.spawn_tunnel_tube_vm = function(vi, area, data, height, direction)
previous_vi = vi previous_vi = vi
if i ~= height then if i ~= height then
data[vi] = c_tunnel_tube data[vi] = c_tunnel_tube
param2_data[vi] = 0
else else
data[vi] = c_tunnel_tube_fruiting_body data[vi] = c_tunnel_tube_fruiting_body
end end