From e1ccd86490be9b5b3357b885bb9c0c4e87d38753 Mon Sep 17 00:00:00 2001 From: Duane Robertson Date: Wed, 21 Sep 2016 15:03:08 -0500 Subject: [PATCH] Correct control complexes. --- mapgen.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mapgen.lua b/mapgen.lua index 77939f1..366fe61 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -206,6 +206,7 @@ local function get_biome(x, y, z) local pz = math.floor(z / fcsize) if px % 10 == 6 and pz % 10 == 6 then + print 'control' return "control" else local hash = px * 1000000 + py * 1000 + pz @@ -227,8 +228,7 @@ local function get_biome(x, y, z) cave_look[hash] = cave_lining end - --return biome_look[hash], cave_look[hash] - return 'deciduous_forest', nil + return biome_look[hash], cave_look[hash] end end @@ -340,7 +340,9 @@ local function generate(p_minp, p_maxp, seed) height = get_height(fdx, fdz, y, index, heights, biomes[biome].terrain_scale, ocean) end - if biome == "control" and math.abs(fdx - half_pod) < 3 and math.abs(fdz - half_pod) < 3 then + if not (data[ivm] == node['air'] or data[ivm] == node['ignore']) then + -- nop + elseif biome == "control" and math.abs(fdx - half_pod) < 3 and math.abs(fdz - half_pod) < 3 then data[ivm] = node["loud_walking:air_ladder"] elseif fdz >= pod_size or fdx >= pod_size or fdy >= pod_size then if (fdy == half_pod and fdx == half_pod) or (fdy == half_pod and fdz == half_pod) then @@ -380,11 +382,11 @@ local function generate(p_minp, p_maxp, seed) data[ivm] = node["loud_walking:control_wall"] elseif biome == "control" then -- - elseif (((fdx == (half_pod - control_off) or fdx == (half_pod + control_off)) and fdz >= (half_pod - control_off) and fdz <= (half_pod + control_off)) or ((fdz == (half_pod - control_off) or fdz == (half_pod + control_off)) and fdx >= (half_pod - control_off) and fdx <= (half_pod + control_off))) and fdx ~= half_pod and fdz ~= half_pod and fdy == csize.y - 2 then + elseif (((fdx == (half_pod - control_off) or fdx == (half_pod + control_off)) and fdz >= (half_pod - control_off) and fdz <= (half_pod + control_off)) or ((fdz == (half_pod - control_off) or fdz == (half_pod + control_off)) and fdx >= (half_pod - control_off) and fdx <= (half_pod + control_off))) and fdx ~= half_pod and fdz ~= half_pod and fdy == pod_size - 2 then data[ivm] = node["loud_walking:controls"] - elseif (((fdx == (half_pod - control_off) or fdx == (half_pod + control_off)) and fdz >= (half_pod - control_off) and fdz <= (half_pod + control_off)) or ((fdz == (half_pod - control_off) or fdz == (half_pod + control_off)) and fdx >= (half_pod - control_off) and fdx <= (half_pod + control_off))) and fdx ~= half_pod and fdz ~= half_pod and fdy > csize.y - control_off then + elseif (((fdx == (half_pod - control_off) or fdx == (half_pod + control_off)) and fdz >= (half_pod - control_off) and fdz <= (half_pod + control_off)) or ((fdz == (half_pod - control_off) or fdz == (half_pod + control_off)) and fdx >= (half_pod - control_off) and fdx <= (half_pod + control_off))) and fdx ~= half_pod and fdz ~= half_pod and fdy > pod_size - control_off then data[ivm] = node[glass[3]] - elseif fdz >= (half_pod - control_off) and fdz <= (half_pod + control_off) and fdx >= (half_pod - control_off) and fdx <= (half_pod + control_off) and fdy == csize.y - control_off then + elseif fdz >= (half_pod - control_off) and fdz <= (half_pod + control_off) and fdx >= (half_pod - control_off) and fdx <= (half_pod + control_off) and fdy == pod_size - control_off then data[ivm] = node[glass[3]] elseif not in_cave and (ocean or swamp or beach) and fdy > height + ground and fdy <= half_pod and fdy == height + ground + 1 then -- ** water decorations ** @@ -487,7 +489,7 @@ local function generate(p_minp, p_maxp, seed) local ocean = string.find(biome, "ocean") and true or false local height = get_height(fdx, fdz, y, index, heights, biomes[biome].terrain_scale, ocean) - if pod and fdy == height + ground and biomes[biome].special_tree_prob and math.random(biomes[biome].special_tree_prob) == 1 then + if biome ~= 'control' and pod and fdy == height + ground and biomes[biome].special_tree_prob and math.random(biomes[biome].special_tree_prob) == 1 then local rx = x + math.random(5) - 1 local rz = z + math.random(5) - 1 local swamp = string.find(biome, "swamp") and true or false