From 9a668204cbd83927a82061745b3d4b5f56543103 Mon Sep 17 00:00:00 2001 From: kay27 Date: Thu, 28 Jan 2021 23:12:16 +0400 Subject: [PATCH] Remove inter-village distance check --- mods/MAPGEN/mcl_villages/init.lua | 2 ++ mods/MAPGEN/mcl_villages/utils.lua | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/mods/MAPGEN/mcl_villages/init.lua b/mods/MAPGEN/mcl_villages/init.lua index fe9ae06305..a931d95235 100644 --- a/mods/MAPGEN/mcl_villages/init.lua +++ b/mods/MAPGEN/mcl_villages/init.lua @@ -113,6 +113,7 @@ minetest.register_on_generated(function(minp, maxp, blockseed) if maxp.y < 0 then return end -- don't build settlements too close to each other + --[[ local center_of_chunk = { x=maxp.x-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) if dist_ok == false then return end + ]] -- don't build settlements on (too) uneven terrain local height_difference = settlements.evaluate_heightmap(minp, maxp) diff --git a/mods/MAPGEN/mcl_villages/utils.lua b/mods/MAPGEN/mcl_villages/utils.lua index f3c66575a2..0e892bfecb 100644 --- a/mods/MAPGEN/mcl_villages/utils.lua +++ b/mods/MAPGEN/mcl_villages/utils.lua @@ -208,17 +208,19 @@ end ------------------------------------------------------------------------------- -- check distance to other settlements ------------------------------------------------------------------------------- +--[[ function settlements.check_distance_other_settlements(center_new_chunk) --- local min_dist_settlements = 300 - for i, pos in ipairs(settlements_in_world) do - local distance = vector.distance(center_new_chunk, pos) --- minetest.chat_send_all("dist ".. distance) - if distance < settlements.min_dist_settlements then - return false - end - end - return true + -- local min_dist_settlements = 300 + for i, pos in ipairs(settlements_in_world) do + local distance = vector.distance(center_new_chunk, pos) + -- minetest.chat_send_all("dist ".. distance) + if distance < settlements.min_dist_settlements then + return false + end + end + return true end +]] ------------------------------------------------------------------------------- -- fill chests -------------------------------------------------------------------------------