aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-03-06 04:46:05 +0000
committerparamat <mat.gregory@virginmedia.com>2015-03-07 01:41:53 +0000
commitffdf8dedb74e59e39a2686a0d7da3740f4f3b2a1 (patch)
tree35f5e132b4909cbe616af9644ee4ebf65d7f7064 /src
parente9eda2b0d0019890cd404e4af25b7adf349e288f (diff)
downloadminetest-ffdf8dedb74e59e39a2686a0d7da3740f4f3b2a1.tar.gz
minetest-ffdf8dedb74e59e39a2686a0d7da3740f4f3b2a1.tar.bz2
minetest-ffdf8dedb74e59e39a2686a0d7da3740f4f3b2a1.zip
Dungeongen: Optionally set ignore to be untouchable to disable floating dungeons
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/dungeongen.cpp9
2 files changed, 7 insertions, 3 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 7b6e366c6..f49fbb008 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -292,6 +292,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("water_level", "1");
settings->setDefault("chunksize", "5");
settings->setDefault("mg_flags", "");
+ settings->setDefault("enable_floating_dungeons", "true");
// IPv6
settings->setDefault("enable_ipv6", "true");
diff --git a/src/dungeongen.cpp b/src/dungeongen.cpp
index eb452a196..3b7e755b3 100644
--- a/src/dungeongen.cpp
+++ b/src/dungeongen.cpp
@@ -79,14 +79,17 @@ 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);
- // Set all air and water to be untouchable to make dungeons open
- // to caves and open air
+ bool no_float = !g_settings->getBool("enable_floating_dungeons");
+
+ // Set all air and water (and optionally ignore) 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)
+ if (c == CONTENT_AIR || c == dp.c_water
+ || (no_float && c == CONTENT_IGNORE))
vm->m_flags[i] |= VMANIP_FLAG_DUNGEON_PRESERVE;
i++;
}