aboutsummaryrefslogtreecommitdiff
path: root/src/mg_decoration.cpp
diff options
context:
space:
mode:
authorparamat <paramat@users.noreply.github.com>2017-09-17 00:26:20 +0100
committerparamat <mat.gregory@virginmedia.com>2017-09-17 05:31:48 +0100
commit27144b471678b30156ad3383fb8d26a5bd9b66cb (patch)
tree853db5930973f5d6c7ef3f1b6e4c354123f7dc8a /src/mg_decoration.cpp
parent76817fdf98b1597c569267bc751f4f285302721a (diff)
downloaddragonfireclient-27144b471678b30156ad3383fb8d26a5bd9b66cb.tar.xz
Biome API: Revert biomes, decos, ores being relative to water level
Feature is unnecessary and would greatly complicate future development, it would also make 'get biome at pos' extremely complex. Mgv7: Revert option to repeat surface biomes in floatlands, which depended on the above.
Diffstat (limited to 'src/mg_decoration.cpp')
-rw-r--r--src/mg_decoration.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/mg_decoration.cpp b/src/mg_decoration.cpp
index 1872e32e7..094694e44 100644
--- a/src/mg_decoration.cpp
+++ b/src/mg_decoration.cpp
@@ -48,7 +48,7 @@ DecorationManager::DecorationManager(IGameDef *gamedef) :
size_t DecorationManager::placeAllDecos(Mapgen *mg, u32 blockseed,
- v3s16 nmin, v3s16 nmax, s16 deco_zero_level)
+ v3s16 nmin, v3s16 nmax)
{
size_t nplaced = 0;
@@ -57,7 +57,7 @@ size_t DecorationManager::placeAllDecos(Mapgen *mg, u32 blockseed,
if (!deco)
continue;
- nplaced += deco->placeDeco(mg, blockseed, nmin, nmax, deco_zero_level);
+ nplaced += deco->placeDeco(mg, blockseed, nmin, nmax);
blockseed++;
}
@@ -124,18 +124,8 @@ bool Decoration::canPlaceDecoration(MMVManip *vm, v3s16 p)
}
-size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed,
- v3s16 nmin, v3s16 nmax, s16 deco_zero_level)
+size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
{
- // Decoration y_min / y_max is displaced by deco_zero_level or remains
- // unchanged. Any decoration with a limit at +-MAX_MAP_GENERATION_LIMIT is
- // considered to have that limit at +-infinity, so we do not alter that limit.
- s32 y_min_disp = (y_min <= -MAX_MAP_GENERATION_LIMIT) ?
- -MAX_MAP_GENERATION_LIMIT : y_min + deco_zero_level;
-
- s32 y_max_disp = (y_max >= MAX_MAP_GENERATION_LIMIT) ?
- MAX_MAP_GENERATION_LIMIT : y_max + deco_zero_level;
-
PcgRandom ps(blockseed + 53);
int carea_size = nmax.X - nmin.X + 1;
@@ -190,7 +180,7 @@ size_t Decoration::placeDeco(Mapgen *mg, u32 blockseed,
else
y = mg->findGroundLevel(v2s16(x, z), nmin.Y, nmax.Y);
- if (y < y_min_disp || y > y_max_disp || y < nmin.Y || y > nmax.Y)
+ if (y < y_min || y > y_max || y < nmin.Y || y > nmax.Y)
continue;
if (y + getHeight() > mg->vm->m_area.MaxEdge.Y)