Fix island distribution again
This commit is contained in:
parent
b08277126c
commit
4c647d9495
|
@ -74,8 +74,8 @@ nodecore.register_limited_abm({
|
|||
label = "Lode Crystal growing",
|
||||
nodenames = {ore},
|
||||
neighbours = {"group:lava"},
|
||||
interval = 10,
|
||||
chance = 10,
|
||||
interval = 20,
|
||||
chance = 20,
|
||||
action = function(pos,node)
|
||||
local vdirs = {}
|
||||
for _,off in pairs(growdirs) do
|
||||
|
|
|
@ -229,9 +229,8 @@ end
|
|||
|
||||
local function gen_island_pos(name)
|
||||
local x,y,z = 0,0,0
|
||||
x,z = x+math.random(-32,32),z+math.random(-32,32)
|
||||
y=256+math.random(-64,64)
|
||||
local ok = checkpos(x,y,z)
|
||||
x,z = x+math.random(-64,64),z+math.random(-64,64)
|
||||
y=256+math.random(-32,32)
|
||||
for k,isl in ipairs(cells) do
|
||||
if isl and isl.valid then
|
||||
table.remove(cells,k)
|
||||
|
@ -245,9 +244,10 @@ local function gen_island_pos(name)
|
|||
return
|
||||
end
|
||||
end
|
||||
local ok = checkpos(x,y,z)
|
||||
while not ok do
|
||||
x,z = x+math.random(-32,32),z+math.random(-32,32)
|
||||
y=256+math.random(-64,64)
|
||||
x,z = x+math.random(-64,64),z+math.random(-64,64)
|
||||
y=256+math.random(-32,32)
|
||||
ok = checkpos(x,y,z)
|
||||
end
|
||||
local ip = {x=x,y=y,z=z}
|
||||
|
|
Loading…
Reference in New Issue