aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-08-27 02:50:45 +0100
committerparamat <mat.gregory@virginmedia.com>2015-08-29 06:27:29 +0100
commit17b7b7c85fc4faca2180a0104ed457c3a8734627 (patch)
treedfd8df1cf3149ec7f96338950842bc2a6e1c07de
parent3304e1e517fb8aac008c4684e72a4b59b408414a (diff)
downloadminetest-17b7b7c85fc4faca2180a0104ed457c3a8734627.tar.gz
minetest-17b7b7c85fc4faca2180a0104ed457c3a8734627.tar.bz2
minetest-17b7b7c85fc4faca2180a0104ed457c3a8734627.zip
Dungeongen: Remove floating frames
Preserves the rare unbroken protruding dungeons Fix random range for first room roomplace Fix checked volume for first room 'fits' bool and check for 'untouchable' flag instead of 'inside' Remove 'enable floating dungeons' setting
-rw-r--r--minetest.conf.example11
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/dungeongen.cpp21
3 files changed, 16 insertions, 17 deletions
diff --git a/minetest.conf.example b/minetest.conf.example
index 9076a7cfd..656abd13b 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -516,18 +516,19 @@
# Mapgen stuff
#
-# Name of map generator to be used. Currently supported: v5, v6, v7, singlenode.
+# Name of map generator to be used.
+# Currently supported: v5, v6, v7, singlenode.
#mg_name = v6
# Water surface level of map
#water_level = 1
# Size of chunks to be generated, stated in mapblocks (16 nodes)
#chunksize = 5
-# Global map generation attributes. Currently supported: trees, caves, flat, dungeons, light.
+# Global map generation attributes.
+# Currently supported: trees, caves, flat, dungeons, light.
# Flags that are not specified in the flag string are not modified from the default.
# To explicitly turn off a flag, prepend "no" to the beginning, e.g. nolight.
+# 'trees' and 'flat' flags only have effect in mgv6.
#mg_flags = trees, caves, dungeons, light
-# Enable/disable floating dungeons and dungeon slices
-#enable_floating_dungeons = true
# Map generation attributes specific to Mapgen V6.
# Currently supported: jungles, biomeblend, mudflow, snowbiomes.
@@ -540,11 +541,13 @@
# Map generation attributes specific to Mapgen V7.
# Currently supported: mountains, ridges.
+# 'ridges' are the rivers.
#mgv7_spflags = mountains, ridges
# Perlin noise attributes for different map generation parameters.
# Noise parameters can be specified as a set of positional values:
# Offset, scale, (spread factors), seed offset, number of octaves, persistence, lacunarity.
+# For example:
#mgv6_np_terrain_base = -4, 20, (250, 250, 250), 82341, 5, 0.6, 2.0
# Or the new group format can be used instead, for example:
#mgv6_np_terrain_base = {
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index f0b02b2d9..dd5332a3b 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -312,7 +312,6 @@ void set_default_settings(Settings *settings)
settings->setDefault("chunksize", "5");
settings->setDefault("mg_flags", "dungeons");
settings->setDefault("mgv6_spflags", "jungles, snowbiomes");
- settings->setDefault("enable_floating_dungeons", "true");
// IPv6
settings->setDefault("enable_ipv6", "true");
diff --git a/src/dungeongen.cpp b/src/dungeongen.cpp
index 8ce64e1e1..9c6e24a60 100644
--- a/src/dungeongen.cpp
+++ b/src/dungeongen.cpp
@@ -80,17 +80,14 @@ void DungeonGen::generate(u32 bseed, v3s16 nmin, v3s16 nmax)
// Dungeon generator doesn't modify places which have this set
vm->clearFlag(VMANIP_FLAG_DUNGEON_INSIDE | VMANIP_FLAG_DUNGEON_PRESERVE);
- bool no_float = !g_settings->getBool("enable_floating_dungeons");
-
- // Set all air and water (and optionally ignore) to be untouchable
+ // Set all air and water to be untouchable
// to make dungeons open to caves and open air
for (s16 z = nmin.Z; z <= nmax.Z; z++) {
for (s16 y = nmin.Y; y <= nmax.Y; y++) {
u32 i = vm->m_area.index(nmin.X, y, z);
for (s16 x = nmin.X; x <= nmax.X; x++) {
content_t c = vm->m_data[i].getContent();
- if (c == CONTENT_AIR || c == dp.c_water ||
- (no_float && c == CONTENT_IGNORE))
+ if (c == CONTENT_AIR || c == dp.c_water)
vm->m_flags[i] |= VMANIP_FLAG_DUNGEON_PRESERVE;
i++;
}
@@ -141,21 +138,21 @@ void DungeonGen::makeDungeon(v3s16 start_padding)
// start_padding is used to disallow starting the generation of
// a dungeon in a neighboring generation chunk
roomplace = vm->m_area.MinEdge + start_padding + v3s16(
- random.range(0, areasize.X - roomsize.X - 1 - start_padding.X),
- random.range(0, areasize.Y - roomsize.Y - 1 - start_padding.Y),
- random.range(0, areasize.Z - roomsize.Z - 1 - start_padding.Z));
+ random.range(0, areasize.X - roomsize.X - start_padding.X),
+ random.range(0, areasize.Y - roomsize.Y - start_padding.Y),
+ random.range(0, areasize.Z - roomsize.Z - start_padding.Z));
/*
Check that we're not putting the room to an unknown place,
otherwise it might end up floating in the air
*/
fits = true;
- for (s16 z = 1; z < roomsize.Z - 1; z++)
- for (s16 y = 1; y < roomsize.Y - 1; y++)
- for (s16 x = 1; x < roomsize.X - 1; x++) {
+ for (s16 z = 0; z < roomsize.Z; z++)
+ for (s16 y = 0; y < roomsize.Y; y++)
+ for (s16 x = 0; x < roomsize.X; x++) {
v3s16 p = roomplace + v3s16(x, y, z);
u32 vi = vm->m_area.index(p);
- if ((vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_INSIDE) ||
+ if ((vm->m_flags[vi] & VMANIP_FLAG_DUNGEON_UNTOUCHABLE) ||
vm->m_data[vi].getContent() == CONTENT_IGNORE) {
fits = false;
break;