1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-01-23 16:30:19 +01:00

fix crash when generate nether

fix crash when generate nether
and fix global variable
This commit is contained in:
crabman77 2015-03-18 01:41:45 +01:00
parent 99d0640d25
commit d73a89f25d

View File

@ -357,7 +357,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
--local perlin2 = minetest.get_perlin(133,3, 0.5, 10) --local perlin2 = minetest.get_perlin(133,3, 0.5, 10)
--local perlin3 = minetest.get_perlin(112,3, 0.5, 5) --local perlin3 = minetest.get_perlin(112,3, 0.5, 5)
local side_length = maxp.x - minp.x - 1 -- maybe mistake here local side_length = maxp.x - minp.x + 1 -- maybe mistake here
local map_lengths_xyz = {x=side_length, y=side_length, z=side_length} local map_lengths_xyz = {x=side_length, y=side_length, z=side_length}
local pmap1 = minetest.get_perlin_map(perlins[1], map_lengths_xyz):get2dMap_flat(minp) local pmap1 = minetest.get_perlin_map(perlins[1], map_lengths_xyz):get2dMap_flat(minp)
@ -390,7 +390,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
local test3 = math.abs(pmap3[count]) local test3 = math.abs(pmap3[count])
local t = math.floor(test*3+0.5) local t = math.floor(test*3+0.5)
local h
if test2 < 0 then if test2 < 0 then
h = math.floor(test2*3+0.5)-1 h = math.floor(test2*3+0.5)-1
else else