Skip to content

Commit 90ed6fc

Browse files
committedJun 25, 2017
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.
1 parent 5a41a98 commit 90ed6fc

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed
 

‎doc/lua_api.txt

+1-6
Original file line numberDiff line numberDiff line change
@@ -1076,12 +1076,7 @@ Ore attributes
10761076
See section "Flag Specifier Format".
10771077

10781078
Currently supported flags:
1079-
`absheight`, `puff_cliffs`, `puff_additive_composition`.
1080-
1081-
### `absheight`
1082-
Also produce this same ore between the height range of `-y_max` and `-y_min`.
1083-
1084-
Useful for having ore in sky realms without having to duplicate ore entries.
1079+
`puff_cliffs`, `puff_additive_composition`.
10851080

10861081
### `puff_cliffs`
10871082
If set, puff ore generation will not taper down large differences in displacement

‎src/mg_ore.cpp

+4-15
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2727

2828

2929
FlagDesc flagdesc_ore[] = {
30-
{"absheight", OREFLAG_ABSHEIGHT},
30+
{"absheight", OREFLAG_ABSHEIGHT}, // Non-functional
3131
{"puff_cliffs", OREFLAG_PUFF_CLIFFS},
3232
{"puff_additive_composition", OREFLAG_PUFF_ADDITIVE},
3333
{NULL, 0}
@@ -87,22 +87,11 @@ void Ore::resolveNodeNames()
8787

8888
size_t Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
8989
{
90-
int in_range = 0;
91-
92-
in_range |= (nmin.Y <= y_max && nmax.Y >= y_min);
93-
if (flags & OREFLAG_ABSHEIGHT)
94-
in_range |= (nmin.Y >= -y_max && nmax.Y <= -y_min) << 1;
95-
if (!in_range)
90+
if (!(nmin.Y <= y_max && nmax.Y >= y_min))
9691
return 0;
9792

98-
int actual_ymin, actual_ymax;
99-
if (in_range & ORE_RANGE_MIRROR) {
100-
actual_ymin = MYMAX(nmin.Y, -y_max);
101-
actual_ymax = MYMIN(nmax.Y, -y_min);
102-
} else {
103-
actual_ymin = MYMAX(nmin.Y, y_min);
104-
actual_ymax = MYMIN(nmax.Y, y_max);
105-
}
93+
int actual_ymin = MYMAX(nmin.Y, y_min);
94+
int actual_ymax = MYMIN(nmax.Y, y_max);
10695
if (clust_size >= actual_ymax - actual_ymin + 1)
10796
return 0;
10897

‎src/mg_ore.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ class MMVManip;
3232

3333
/////////////////// Ore generation flags
3434

35-
#define OREFLAG_ABSHEIGHT 0x01
35+
#define OREFLAG_ABSHEIGHT 0x01 // Non-functional but kept to not break flags
3636
#define OREFLAG_PUFF_CLIFFS 0x02
3737
#define OREFLAG_PUFF_ADDITIVE 0x04
3838
#define OREFLAG_USE_NOISE 0x08
3939

40-
#define ORE_RANGE_ACTUAL 1
41-
#define ORE_RANGE_MIRROR 2
42-
4340
enum OreType {
4441
ORE_SCATTER,
4542
ORE_SHEET,

0 commit comments

Comments
 (0)