Biomemap: Simplify code of recent commit (#7398)
authorParamat <paramat@users.noreply.github.com>
Sat, 2 Jun 2018 20:28:26 +0000 (21:28 +0100)
committerGitHub <noreply@github.com>
Sat, 2 Jun 2018 20:28:26 +0000 (21:28 +0100)
src/mapgen/mapgen.cpp

index eb7803144bb7653a92dc87df0b88136e4f218a1f..6163d17afacb6427ee2a5e2ea796fc588f45f8cc 100644 (file)
@@ -765,15 +765,12 @@ void MapgenBasic::generateBiomes()
                // If no stone surface was detected in this mapchunk column the biomemap
                // will be empty for this (x, z) position. Add the currently active
                // biome to the biomemap, or if biome is NULL calculate it for this
-               // position.
+               // position and add it.
                if (biomemap[index] == BIOME_NONE) {
-                       if (biome) {
-                               biomemap[index] = biome->index;
-                       } else {
-                               biome =
-                                       biomegen->getBiomeAtIndex(index, v3s16(x, node_min.Y, z));
-                               biomemap[index] = biome->index;
-                       }
+                       if (!biome)
+                               biome = biomegen->getBiomeAtIndex(
+                                       index, v3s16(x, node_min.Y, z));
+                       biomemap[index] = biome->index;
                }
        }
 }