summaryrefslogtreecommitdiff
path: root/src/mapgen_v6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapgen_v6.cpp')
-rw-r--r--src/mapgen_v6.cpp117
1 files changed, 75 insertions, 42 deletions
diff --git a/src/mapgen_v6.cpp b/src/mapgen_v6.cpp
index 79617a830..fe2b0b36f 100644
--- a/src/mapgen_v6.cpp
+++ b/src/mapgen_v6.cpp
@@ -1,6 +1,8 @@
/*
Minetest
Copyright (C) 2010-2015 celeron55, Perttu Ahola <celeron55@gmail.com>
+Copyright (C) 2013-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
+Copyright (C) 2014-2017 paramat
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -99,18 +101,12 @@ MapgenV6::MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge)
c_snowblock = ndef->getId("mapgen_snowblock");
c_ice = ndef->getId("mapgen_ice");
- c_cobble = ndef->getId("mapgen_cobble");
- c_stair_cobble = ndef->getId("mapgen_stair_cobble");
- c_mossycobble = ndef->getId("mapgen_mossycobble");
-
- if (c_desert_sand == CONTENT_IGNORE)
- c_desert_sand = c_sand;
+ if (c_gravel == CONTENT_IGNORE)
+ c_gravel = c_stone;
if (c_desert_stone == CONTENT_IGNORE)
c_desert_stone = c_stone;
- if (c_mossycobble == CONTENT_IGNORE)
- c_mossycobble = c_cobble;
- if (c_stair_cobble == CONTENT_IGNORE)
- c_stair_cobble = c_cobble;
+ if (c_desert_sand == CONTENT_IGNORE)
+ c_desert_sand = c_sand;
if (c_dirt_with_snow == CONTENT_IGNORE)
c_dirt_with_snow = c_dirt_with_grass;
if (c_snow == CONTENT_IGNORE)
@@ -119,6 +115,18 @@ MapgenV6::MapgenV6(int mapgenid, MapgenV6Params *params, EmergeManager *emerge)
c_snowblock = c_dirt_with_grass;
if (c_ice == CONTENT_IGNORE)
c_ice = c_water_source;
+
+ c_cobble = ndef->getId("mapgen_cobble");
+ c_mossycobble = ndef->getId("mapgen_mossycobble");
+ c_stair_cobble = ndef->getId("mapgen_stair_cobble");
+ c_stair_desert_stone = ndef->getId("mapgen_stair_desert_stone");
+
+ if (c_mossycobble == CONTENT_IGNORE)
+ c_mossycobble = c_cobble;
+ if (c_stair_cobble == CONTENT_IGNORE)
+ c_stair_cobble = c_cobble;
+ if (c_stair_desert_stone == CONTENT_IGNORE)
+ c_stair_desert_stone = c_desert_stone;
}
@@ -558,34 +566,47 @@ void MapgenV6::makeChunk(BlockMakeData *data)
if ((flags & MG_DUNGEONS) && (stone_surface_max_y >= node_min.Y)) {
DungeonParams dp;
- dp.seed = seed;
- dp.c_water = c_water_source;
- dp.c_river_water = c_water_source;
- dp.rooms_min = 2;
- dp.rooms_max = 16;
- dp.y_min = -MAX_MAP_GENERATION_LIMIT;
- dp.y_max = MAX_MAP_GENERATION_LIMIT;
- dp.np_density = NoiseParams(0.9, 0.5, v3f(500.0, 500.0, 500.0), 0, 2, 0.8, 2.0);
- dp.np_alt_wall = NoiseParams(-0.4, 1.0, v3f(40.0, 40.0, 40.0), 32474, 6, 1.1, 2.0);
+ dp.seed = seed;
+ dp.c_water = c_water_source;
+ dp.c_river_water = c_water_source;
+
+ dp.only_in_ground = true;
+ dp.corridor_len_min = 1;
+ dp.corridor_len_max = 13;
+ dp.rooms_min = 2;
+ dp.rooms_max = 16;
+ dp.y_min = -MAX_MAP_GENERATION_LIMIT;
+ dp.y_max = MAX_MAP_GENERATION_LIMIT;
+
+ dp.np_density
+ = NoiseParams(0.9, 0.5, v3f(500.0, 500.0, 500.0), 0, 2, 0.8, 2.0);
+ dp.np_alt_wall
+ = NoiseParams(-0.4, 1.0, v3f(40.0, 40.0, 40.0), 32474, 6, 1.1, 2.0);
if (getBiome(0, v2s16(node_min.X, node_min.Z)) == BT_DESERT) {
- dp.c_wall = c_desert_stone;
- dp.c_alt_wall = CONTENT_IGNORE;
- dp.c_stair = c_desert_stone;
-
- dp.diagonal_dirs = true;
- dp.holesize = v3s16(2, 3, 2);
- dp.roomsize = v3s16(2, 5, 2);
- dp.notifytype = GENNOTIFY_TEMPLE;
+ dp.c_wall = c_desert_stone;
+ dp.c_alt_wall = CONTENT_IGNORE;
+ dp.c_stair = c_stair_desert_stone;
+
+ dp.diagonal_dirs = true;
+ dp.holesize = v3s16(2, 3, 2);
+ dp.room_size_min = v3s16(6, 9, 6);
+ dp.room_size_max = v3s16(10, 11, 10);
+ dp.room_size_large_min = v3s16(10, 13, 10);
+ dp.room_size_large_max = v3s16(18, 21, 18);
+ dp.notifytype = GENNOTIFY_TEMPLE;
} else {
- dp.c_wall = c_cobble;
- dp.c_alt_wall = c_mossycobble;
- dp.c_stair = c_stair_cobble;
-
- dp.diagonal_dirs = false;
- dp.holesize = v3s16(1, 2, 1);
- dp.roomsize = v3s16(0, 0, 0);
- dp.notifytype = GENNOTIFY_DUNGEON;
+ dp.c_wall = c_cobble;
+ dp.c_alt_wall = c_mossycobble;
+ dp.c_stair = c_stair_cobble;
+
+ dp.diagonal_dirs = false;
+ dp.holesize = v3s16(1, 2, 1);
+ dp.room_size_min = v3s16(4, 4, 4);
+ dp.room_size_max = v3s16(8, 6, 8);
+ dp.room_size_large_min = v3s16(8, 8, 8);
+ dp.room_size_large_max = v3s16(16, 16, 16);
+ dp.notifytype = GENNOTIFY_DUNGEON;
}
DungeonGen dgen(ndef, &gennotify, &dp);
@@ -817,13 +838,17 @@ void MapgenV6::flowMud(s16 &mudflow_minpos, s16 &mudflow_maxpos)
v3s16(-1, 0, 0), // left
};
- // Check that upper is air or doesn't exist.
- // Cancel dropping if upper keeps it in place
+ // Check that upper is walkable. Cancel
+ // dropping if upper keeps it in place.
u32 i3 = i;
vm->m_area.add_y(em, i3, 1);
- if (vm->m_area.contains(i3) == true &&
- ndef->get(vm->m_data[i3]).walkable)
- continue;
+ MapNode *n3 = NULL;
+
+ if (vm->m_area.contains(i3)) {
+ n3 = &vm->m_data[i3];
+ if (ndef->get(*n3).walkable)
+ continue;
+ }
// Drop mud on side
for (u32 di = 0; di < 4; di++) {
@@ -866,10 +891,18 @@ void MapgenV6::flowMud(s16 &mudflow_minpos, s16 &mudflow_maxpos)
if (!dropped_to_unknown) {
*n2 = *n;
// Set old place to be air (or water)
- if (old_is_water)
+ if (old_is_water) {
*n = MapNode(c_water_source);
- else
+ } else {
*n = MapNode(CONTENT_AIR);
+ // Upper (n3) is not walkable or is NULL. If it is
+ // not NULL and not air and not water it is a
+ // decoration that needs removing, to avoid
+ // unsupported decorations.
+ if (n3 && n3->getContent() != CONTENT_AIR &&
+ n3->getContent() != c_water_source)
+ *n3 = MapNode(CONTENT_AIR);
+ }
}
// Done