Extra error checking.

This commit is contained in:
Duane 2016-07-15 02:58:33 -05:00
parent aa999e2ed5
commit bf26b8bee1
25 changed files with 897 additions and 314 deletions

View file

@ -43,11 +43,17 @@ local plant_noise = {offset = 0.0, scale = 1.0, spread = {x = 200, y = 200, z =
local biome_noise = {offset = 0.0, scale = 1.0, spread = {x = 400, y = 400, z = 400}, seed = -1471, octaves = 3, persist = 0.5, lacunarity = 2.0}
fun_caves.asteroids = function(minp, maxp, data, p2data, area, node)
if not (minp and maxp and data and p2data and area and node and type(data) == 'table' and type(p2data) == 'table') then
return
end
if minp.y < 11168 or minp.y > 15168 then
return
end
math.randomseed(minetest.get_us_time())
-- What's this for?
--math.randomseed(minetest.get_us_time())
local density = 4 + math.abs(minp.y - 13168) / 500
local empty = false
if math.random(math.floor(density)) ~= 1 then
@ -60,6 +66,9 @@ fun_caves.asteroids = function(minp, maxp, data, p2data, area, node)
local map_min = {x = minp.x, y = minp.y, z = minp.z}
local asteroid_1 = minetest.get_perlin_map(asteroid_noise_1, map_max):get3dMap_flat(map_min)
if not asteroid_1 then
return
end
local write = false