increased blend radius so that larger buildings like the chateau with garden can be spawned
parent
5a988de512
commit
29b803901e
21
villages.lua
21
villages.lua
|
@ -736,8 +736,16 @@ mg_villages.houses_in_one_mapchunk = function( minp, mapchunk_size, villages, vn
|
||||||
zdim = bsizez
|
zdim = bsizez
|
||||||
end
|
end
|
||||||
local blenrad = math.floor((math.max(xdim, zdim) + 16) / 2)+2 -- radius of blend area
|
local blenrad = math.floor((math.max(xdim, zdim) + 16) / 2)+2 -- radius of blend area
|
||||||
|
--[[
|
||||||
|
if( blenrad >= math.ceil(mapchunk_size/2)-2 ) then
|
||||||
|
blenrad = math.floor(mapchunk_size/2)-2;
|
||||||
|
end
|
||||||
local blencenx = pr:next(minp.x + blenrad, minp.x + mapchunk_size - blenrad - 1) -- blend area centre point
|
local blencenx = pr:next(minp.x + blenrad, minp.x + mapchunk_size - blenrad - 1) -- blend area centre point
|
||||||
local blencenz = pr:next(minp.z + blenrad, minp.z + mapchunk_size - blenrad - 1)
|
local blencenz = pr:next(minp.z + blenrad, minp.z + mapchunk_size - blenrad - 1)
|
||||||
|
--]]
|
||||||
|
local blencenx = pr:next(minp.x, minp.x + mapchunk_size - 1) -- blend area centre point
|
||||||
|
local blencenz = pr:next(minp.z, minp.z + mapchunk_size - 1)
|
||||||
|
|
||||||
local minx = blencenx - math.ceil(xdim / 2) -- minimum point of house plus front flat area
|
local minx = blencenx - math.ceil(xdim / 2) -- minimum point of house plus front flat area
|
||||||
local minz = blencenz - math.ceil(zdim / 2)
|
local minz = blencenz - math.ceil(zdim / 2)
|
||||||
local bx, bz -- house minimum point
|
local bx, bz -- house minimum point
|
||||||
|
@ -787,19 +795,22 @@ end
|
||||||
-- they may be so close to the border that they will affect this mapchunk
|
-- they may be so close to the border that they will affect this mapchunk
|
||||||
mg_villages.houses_in_mapchunk = function( minp, mapchunk_size, villages )
|
mg_villages.houses_in_mapchunk = function( minp, mapchunk_size, villages )
|
||||||
local village_noise = minetest.get_perlin(7635, 3, 0.5, 16);
|
local village_noise = minetest.get_perlin(7635, 3, 0.5, 16);
|
||||||
|
local vcr = mg_villages.VILLAGE_CHECK_RADIUS
|
||||||
|
for xi = -vcr, vcr do
|
||||||
|
for zi = -vcr, vcr do
|
||||||
-- for x=-1,1 do
|
-- for x=-1,1 do
|
||||||
-- for z=-1,1 do
|
-- for z=-1,1 do
|
||||||
local x = 0;
|
-- local x = 0;
|
||||||
local z = 0;
|
-- local z = 0;
|
||||||
local new_village = mg_villages.houses_in_one_mapchunk(
|
local new_village = mg_villages.houses_in_one_mapchunk(
|
||||||
{x=minp.x+(x*mapchunk_size), y=minp.y, z=minp.z+(z*mapchunk_size)},
|
{x=minp.x+(xi*mapchunk_size), y=minp.y, z=minp.z+(zi*mapchunk_size)},
|
||||||
mapchunk_size,
|
mapchunk_size,
|
||||||
villages,
|
villages,
|
||||||
village_noise );
|
village_noise );
|
||||||
if( new_village and new_village.vs and new_village.vx and new_village.vz ) then
|
if( new_village and new_village.vs and new_village.vx and new_village.vz ) then
|
||||||
table.insert( villages, new_village );
|
table.insert( villages, new_village );
|
||||||
end
|
end
|
||||||
-- end
|
end
|
||||||
-- end
|
end
|
||||||
return villages;
|
return villages;
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue