forked from VoxeLibre/VoxeLibre
Remove inter-village distance check
This commit is contained in:
parent
e66d66caf9
commit
9a668204cb
|
@ -113,6 +113,7 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
if maxp.y < 0 then return end
|
if maxp.y < 0 then return end
|
||||||
|
|
||||||
-- don't build settlements too close to each other
|
-- don't build settlements too close to each other
|
||||||
|
--[[
|
||||||
local center_of_chunk = {
|
local center_of_chunk = {
|
||||||
x=maxp.x-half_map_chunk_size,
|
x=maxp.x-half_map_chunk_size,
|
||||||
y=maxp.y-half_map_chunk_size,
|
y=maxp.y-half_map_chunk_size,
|
||||||
|
@ -120,6 +121,7 @@ minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||||
}
|
}
|
||||||
local dist_ok = settlements.check_distance_other_settlements(center_of_chunk)
|
local dist_ok = settlements.check_distance_other_settlements(center_of_chunk)
|
||||||
if dist_ok == false then return end
|
if dist_ok == false then return end
|
||||||
|
]]
|
||||||
|
|
||||||
-- don't build settlements on (too) uneven terrain
|
-- don't build settlements on (too) uneven terrain
|
||||||
local height_difference = settlements.evaluate_heightmap(minp, maxp)
|
local height_difference = settlements.evaluate_heightmap(minp, maxp)
|
||||||
|
|
|
@ -208,17 +208,19 @@ end
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- check distance to other settlements
|
-- check distance to other settlements
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
--[[
|
||||||
function settlements.check_distance_other_settlements(center_new_chunk)
|
function settlements.check_distance_other_settlements(center_new_chunk)
|
||||||
-- local min_dist_settlements = 300
|
-- local min_dist_settlements = 300
|
||||||
for i, pos in ipairs(settlements_in_world) do
|
for i, pos in ipairs(settlements_in_world) do
|
||||||
local distance = vector.distance(center_new_chunk, pos)
|
local distance = vector.distance(center_new_chunk, pos)
|
||||||
-- minetest.chat_send_all("dist ".. distance)
|
-- minetest.chat_send_all("dist ".. distance)
|
||||||
if distance < settlements.min_dist_settlements then
|
if distance < settlements.min_dist_settlements then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
]]
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- fill chests
|
-- fill chests
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
Reference in New Issue