aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2017-04-04 06:51:58 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-04-04 07:51:58 +0200
commitb8a4c95971bff050f6fad8ce740c3be949a321a6 (patch)
treece21539d34221feba579889c3ef3ee585d7de001
parent563199698dedeec473108d1c333a2a0d88e541d1 (diff)
downloadminetest-b8a4c95971bff050f6fad8ce740c3be949a321a6.tar.gz
minetest-b8a4c95971bff050f6fad8ce740c3be949a321a6.tar.bz2
minetest-b8a4c95971bff050f6fad8ce740c3be949a321a6.zip
MapgenBasic: Add lava source as commonly used content (#5512)
Future mapgens are likely to use this for magma and volcanos. Remove the getting of lava source content id in mgvalleys.
-rw-r--r--src/mapgen.cpp1
-rw-r--r--src/mapgen.h5
-rw-r--r--src/mapgen_valleys.cpp3
-rw-r--r--src/mapgen_valleys.h2
4 files changed, 4 insertions, 7 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index c63c426fa..bd0e94ac7 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -593,6 +593,7 @@ MapgenBasic::MapgenBasic(int mapgenid, MapgenParams *params, EmergeManager *emer
c_sandstone = ndef->getId("mapgen_sandstone");
c_water_source = ndef->getId("mapgen_water_source");
c_river_water_source = ndef->getId("mapgen_river_water_source");
+ c_lava_source = ndef->getId("mapgen_lava_source");
// Fall back to more basic content if not defined
// river_water_source cannot fallback to water_source because river water
diff --git a/src/mapgen.h b/src/mapgen.h
index f738b1bce..653b79ed8 100644
--- a/src/mapgen.h
+++ b/src/mapgen.h
@@ -261,10 +261,11 @@ protected:
// Content required for generateBiomes
content_t c_stone;
- content_t c_water_source;
- content_t c_river_water_source;
content_t c_desert_stone;
content_t c_sandstone;
+ content_t c_water_source;
+ content_t c_river_water_source;
+ content_t c_lava_source;
// Content required for generateDungeons
content_t c_cobble;
diff --git a/src/mapgen_valleys.cpp b/src/mapgen_valleys.cpp
index 76a7a0582..af29eb3bd 100644
--- a/src/mapgen_valleys.cpp
+++ b/src/mapgen_valleys.cpp
@@ -107,9 +107,6 @@ MapgenValleys::MapgenValleys(int mapgenid, MapgenValleysParams *params, EmergeMa
this->lava_max_height = water_level + MYMAX(0, lava_features_lim - 4) * 50;
tcave_cache = new float[csize.Y + 2];
-
- // Resolve content to be used
- c_lava_source = ndef->getId("mapgen_lava_source");
}
diff --git a/src/mapgen_valleys.h b/src/mapgen_valleys.h
index 4a7a11bcc..0c67c3232 100644
--- a/src/mapgen_valleys.h
+++ b/src/mapgen_valleys.h
@@ -124,8 +124,6 @@ private:
Noise *noise_valley_depth;
Noise *noise_valley_profile;
- content_t c_lava_source;
-
float terrainLevelAtPoint(s16 x, s16 z);
void calculateNoise();