aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparamat <mat.gregory@virginmedia.com>2015-11-28 14:51:22 +0000
committerparamat <mat.gregory@virginmedia.com>2015-11-29 21:55:43 +0000
commit452c88308c80dc52df95d5c2a9e0e105154684d0 (patch)
tree49f4fbadec4a7d08add42c7c43ed32444e49d5d6
parent900db310638531a8b9fb1a587f75a02a15ae0c24 (diff)
downloadminetest-452c88308c80dc52df95d5c2a9e0e105154684d0.tar.gz
minetest-452c88308c80dc52df95d5c2a9e0e105154684d0.tar.bz2
minetest-452c88308c80dc52df95d5c2a9e0e105154684d0.zip
Dungeongen: Also preserve river water nodes
For future river mapgens Dungeons will not generate in river water, to avoid dungeons filling and blocking river channels
-rw-r--r--src/dungeongen.cpp5
-rw-r--r--src/dungeongen.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/dungeongen.cpp b/src/dungeongen.cpp
index 9c6e24a60..bfaad9faa 100644
--- a/src/dungeongen.cpp
+++ b/src/dungeongen.cpp
@@ -65,6 +65,9 @@ DungeonGen::DungeonGen(Mapgen *mapgen, DungeonParams *dparams)
dp.np_wetness = nparams_dungeon_wetness;
dp.np_density = nparams_dungeon_density;
}
+
+ // For mapgens using river water
+ dp.c_river_water = mg->ndef->getId("mapgen_river_water_source");
}
@@ -87,7 +90,7 @@ void DungeonGen::generate(u32 bseed, v3s16 nmin, v3s16 nmax)
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 || c == dp.c_river_water)
vm->m_flags[i] |= VMANIP_FLAG_DUNGEON_PRESERVE;
i++;
}
diff --git a/src/dungeongen.h b/src/dungeongen.h
index 4e1201d82..d209dd4bf 100644
--- a/src/dungeongen.h
+++ b/src/dungeongen.h
@@ -40,6 +40,7 @@ int dir_to_facedir(v3s16 d);
struct DungeonParams {
content_t c_water;
+ content_t c_river_water;
content_t c_cobble;
content_t c_moss;
content_t c_stair;