Mapgen v7: Fix uninitialized spflags
authorkwolekr <kwolekr@minetest.net>
Thu, 13 Nov 2014 04:58:50 +0000 (23:58 -0500)
committerkwolekr <kwolekr@minetest.net>
Thu, 13 Nov 2014 04:58:50 +0000 (23:58 -0500)
Mapgen v5: Fix minor style issue

src/mapgen_v5.cpp
src/mapgen_v7.cpp

index afe34164c78694395e788880e93709c015ec1d23..e98b211af9c2b3357e42e7816ca50a4fa3e81350 100644 (file)
@@ -412,11 +412,11 @@ void MapgenV5::generateBiomes() {
                
                for (s16 y = node_max.Y; y >= node_min.Y; y--) {
                        content_t c = vm->m_data[i].getContent();
-                       if ((c == c_stone || c == c_dirt_with_grass
-                                       || c == c_dirt
-                                       || c == c_sand
-                                       || c == c_lava_source
-                                       || c == c_gravel) && have_air) {
+                       bool is_replaceable_content =
+                               c == c_stone || c == c_dirt_with_grass || c == c_dirt ||
+                               c == c_sand  || c == c_lava_source     || c == c_gravel;
+
+                       if (is_replaceable_content && have_air) {
                                content_t c_below = vm->m_data[i - em.X].getContent();
                                
                                if (c_below != CONTENT_AIR) {
index 8961d84317bd13ae58169377afccd188105b06d5..39f0984a16ba186392693d14926c3746eae726c5 100644 (file)
@@ -72,6 +72,7 @@ MapgenV7::MapgenV7(int mapgenid, MapgenParams *params, EmergeManager *emerge) {
        this->ridge_heightmap = new s16[csize.X * csize.Z];
 
        MapgenV7Params *sp = (MapgenV7Params *)params->sparams;
+       this->spflags = sp->spflags;
 
        //// Terrain noise
        noise_terrain_base    = new Noise(&sp->np_terrain_base,    seed, csize.X, csize.Z);