diff options
author | paramat <paramat@users.noreply.github.com> | 2017-06-22 06:50:22 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2017-06-25 05:01:42 +0100 |
commit | 90ed6fc732ca667ca970b7c38d39c809e5c3553e (patch) | |
tree | b8c53a98f59cf4ff2148849676448551b0005526 /src/mg_ore.cpp | |
parent | 5a41a98ff6ac899038bfc359912ebb021479451b (diff) | |
download | minetest-90ed6fc732ca667ca970b7c38d39c809e5c3553e.tar.gz minetest-90ed6fc732ca667ca970b7c38d39c809e5c3553e.tar.bz2 minetest-90ed6fc732ca667ca970b7c38d39c809e5c3553e.zip |
Ores: Make 'absheight' flag non-functional
The 'absheight' flag was added years ago for the floatlands of 'indev'
mapgen (now deleted). The feature mirrored all ore placement around y = 0
to place ores in floatlands.
In MTG we now use dedicated ore registrations for floatlands.
The feature is crude, inflexible, problematic and very rarely used, it
also makes ore vertical range code more complex.
Minetest 0.5 is a good chance to remove the feature.
The flag itself remains to not break flag values.
Diffstat (limited to 'src/mg_ore.cpp')
-rw-r--r-- | src/mg_ore.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/mg_ore.cpp b/src/mg_ore.cpp index f959ca9e6..73af2e2e6 100644 --- a/src/mg_ore.cpp +++ b/src/mg_ore.cpp @@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., FlagDesc flagdesc_ore[] = { - {"absheight", OREFLAG_ABSHEIGHT}, + {"absheight", OREFLAG_ABSHEIGHT}, // Non-functional {"puff_cliffs", OREFLAG_PUFF_CLIFFS}, {"puff_additive_composition", OREFLAG_PUFF_ADDITIVE}, {NULL, 0} @@ -87,22 +87,11 @@ void Ore::resolveNodeNames() size_t Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { - int in_range = 0; - - in_range |= (nmin.Y <= y_max && nmax.Y >= y_min); - if (flags & OREFLAG_ABSHEIGHT) - in_range |= (nmin.Y >= -y_max && nmax.Y <= -y_min) << 1; - if (!in_range) + if (!(nmin.Y <= y_max && nmax.Y >= y_min)) return 0; - int actual_ymin, actual_ymax; - if (in_range & ORE_RANGE_MIRROR) { - actual_ymin = MYMAX(nmin.Y, -y_max); - actual_ymax = MYMIN(nmax.Y, -y_min); - } else { - actual_ymin = MYMAX(nmin.Y, y_min); - actual_ymax = MYMIN(nmax.Y, y_max); - } + 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; |