summaryrefslogtreecommitdiff
path: root/src/mapgen/mapgen.cpp
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-06-02 21:28:26 +0100
committerGitHub <noreply@github.com>2018-06-02 21:28:26 +0100
commitf4ca830abe1aa22875c99b31bf2ee56e26f83f05 (patch)
tree7bfcc7297944a762b788832de8d6316b4501fa06 /src/mapgen/mapgen.cpp
parent99143f494711034068685b6ee845ce19fa09d7d9 (diff)
downloadminetest-f4ca830abe1aa22875c99b31bf2ee56e26f83f05.tar.gz
minetest-f4ca830abe1aa22875c99b31bf2ee56e26f83f05.tar.bz2
minetest-f4ca830abe1aa22875c99b31bf2ee56e26f83f05.zip
Biomemap: Simplify code of recent commit (#7398)
Diffstat (limited to 'src/mapgen/mapgen.cpp')
-rw-r--r--src/mapgen/mapgen.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp
index eb7803144..6163d17af 100644
--- a/src/mapgen/mapgen.cpp
+++ b/src/mapgen/mapgen.cpp
@@ -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;
}
}
}