diff options
author | paramat <paramat@users.noreply.github.com> | 2017-09-17 00:26:20 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-09-17 05:31:48 +0100 |
commit | 27144b471678b30156ad3383fb8d26a5bd9b66cb (patch) | |
tree | 853db5930973f5d6c7ef3f1b6e4c354123f7dc8a /src/mg_ore.cpp | |
parent | 76817fdf98b1597c569267bc751f4f285302721a (diff) | |
download | hax-minetest-server-27144b471678b30156ad3383fb8d26a5bd9b66cb.tar.gz hax-minetest-server-27144b471678b30156ad3383fb8d26a5bd9b66cb.zip |
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_ore.cpp')
-rw-r--r-- | src/mg_ore.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/mg_ore.cpp b/src/mg_ore.cpp index 54e332116..4f4c9c711 100644 --- a/src/mg_ore.cpp +++ b/src/mg_ore.cpp @@ -44,8 +44,7 @@ OreManager::OreManager(IGameDef *gamedef) : } -size_t OreManager::placeAllOres(Mapgen *mg, u32 blockseed, - v3s16 nmin, v3s16 nmax, s16 ore_zero_level) +size_t OreManager::placeAllOres(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { size_t nplaced = 0; @@ -54,7 +53,7 @@ size_t OreManager::placeAllOres(Mapgen *mg, u32 blockseed, if (!ore) continue; - nplaced += ore->placeOre(mg, blockseed, nmin, nmax, ore_zero_level); + nplaced += ore->placeOre(mg, blockseed, nmin, nmax); blockseed++; } @@ -88,23 +87,13 @@ void Ore::resolveNodeNames() } -size_t Ore::placeOre(Mapgen *mg, u32 blockseed, - v3s16 nmin, v3s16 nmax, s16 ore_zero_level) +size_t Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { - // Ore y_min / y_max is displaced by ore_zero_level or remains unchanged. - // Any ore 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 + ore_zero_level; - - s32 y_max_disp = (y_max >= MAX_MAP_GENERATION_LIMIT) ? - MAX_MAP_GENERATION_LIMIT : y_max + ore_zero_level; - - if (nmin.Y > y_max_disp || nmax.Y < y_min_disp) + if (nmin.Y > y_max || nmax.Y < y_min) return 0; - int actual_ymin = MYMAX(nmin.Y, y_min_disp); - int actual_ymax = MYMIN(nmax.Y, y_max_disp); + int actual_ymin = MYMAX(nmin.Y, y_min); + int actual_ymax = MYMIN(nmax.Y, y_max); if (clust_size >= actual_ymax - actual_ymin + 1) return 0; |