diff options
author | paramat <mat.gregory@virginmedia.com> | 2015-08-27 02:50:45 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2015-08-29 06:27:29 +0100 |
commit | 17b7b7c85fc4faca2180a0104ed457c3a8734627 (patch) | |
tree | dfd8df1cf3149ec7f96338950842bc2a6e1c07de /src | |
parent | 3304e1e517fb8aac008c4684e72a4b59b408414a (diff) | |
download | minetest-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
Diffstat (limited to 'src')
-rw-r--r-- | src/defaultsettings.cpp | 1 | ||||
-rw-r--r-- | src/dungeongen.cpp | 21 |
2 files changed, 9 insertions, 13 deletions
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; |