Navigation Menu

Skip to content

Commit

Permalink
MapgenBasic: Add lava source as commonly used content (#5512)
Browse files Browse the repository at this point in the history
Future mapgens are likely to use this for magma and volcanos.
Remove the getting of lava source content id in mgvalleys.
  • Loading branch information
paramat authored and nerzhul committed Apr 4, 2017
1 parent 5631996 commit b8a4c95
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/mapgen.cpp
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/mapgen.h
Expand Up @@ -261,10 +261,11 @@ class MapgenBasic : public Mapgen {

// 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;
Expand Down
3 changes: 0 additions & 3 deletions src/mapgen_valleys.cpp
Expand Up @@ -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");
}


Expand Down
2 changes: 0 additions & 2 deletions src/mapgen_valleys.h
Expand Up @@ -124,8 +124,6 @@ class MapgenValleys : public MapgenBasic {
Noise *noise_valley_depth;
Noise *noise_valley_profile;

content_t c_lava_source;

float terrainLevelAtPoint(s16 x, s16 z);

void calculateNoise();
Expand Down

0 comments on commit b8a4c95

Please sign in to comment.