forked from Mirrorlandia_minetest/minetest
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.
This commit is contained in:
parent
5a41a98ff6
commit
90ed6fc732
@ -1076,12 +1076,7 @@ Ore attributes
|
|||||||
See section "Flag Specifier Format".
|
See section "Flag Specifier Format".
|
||||||
|
|
||||||
Currently supported flags:
|
Currently supported flags:
|
||||||
`absheight`, `puff_cliffs`, `puff_additive_composition`.
|
`puff_cliffs`, `puff_additive_composition`.
|
||||||
|
|
||||||
### `absheight`
|
|
||||||
Also produce this same ore between the height range of `-y_max` and `-y_min`.
|
|
||||||
|
|
||||||
Useful for having ore in sky realms without having to duplicate ore entries.
|
|
||||||
|
|
||||||
### `puff_cliffs`
|
### `puff_cliffs`
|
||||||
If set, puff ore generation will not taper down large differences in displacement
|
If set, puff ore generation will not taper down large differences in displacement
|
||||||
|
@ -27,7 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
|
|
||||||
|
|
||||||
FlagDesc flagdesc_ore[] = {
|
FlagDesc flagdesc_ore[] = {
|
||||||
{"absheight", OREFLAG_ABSHEIGHT},
|
{"absheight", OREFLAG_ABSHEIGHT}, // Non-functional
|
||||||
{"puff_cliffs", OREFLAG_PUFF_CLIFFS},
|
{"puff_cliffs", OREFLAG_PUFF_CLIFFS},
|
||||||
{"puff_additive_composition", OREFLAG_PUFF_ADDITIVE},
|
{"puff_additive_composition", OREFLAG_PUFF_ADDITIVE},
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
@ -87,22 +87,11 @@ void Ore::resolveNodeNames()
|
|||||||
|
|
||||||
size_t Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
|
size_t Ore::placeOre(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
|
||||||
{
|
{
|
||||||
int in_range = 0;
|
if (!(nmin.Y <= y_max && nmax.Y >= y_min))
|
||||||
|
|
||||||
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)
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int actual_ymin, actual_ymax;
|
int actual_ymin = MYMAX(nmin.Y, y_min);
|
||||||
if (in_range & ORE_RANGE_MIRROR) {
|
int actual_ymax = MYMIN(nmax.Y, y_max);
|
||||||
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);
|
|
||||||
}
|
|
||||||
if (clust_size >= actual_ymax - actual_ymin + 1)
|
if (clust_size >= actual_ymax - actual_ymin + 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -32,14 +32,11 @@ class MMVManip;
|
|||||||
|
|
||||||
/////////////////// Ore generation flags
|
/////////////////// Ore generation flags
|
||||||
|
|
||||||
#define OREFLAG_ABSHEIGHT 0x01
|
#define OREFLAG_ABSHEIGHT 0x01 // Non-functional but kept to not break flags
|
||||||
#define OREFLAG_PUFF_CLIFFS 0x02
|
#define OREFLAG_PUFF_CLIFFS 0x02
|
||||||
#define OREFLAG_PUFF_ADDITIVE 0x04
|
#define OREFLAG_PUFF_ADDITIVE 0x04
|
||||||
#define OREFLAG_USE_NOISE 0x08
|
#define OREFLAG_USE_NOISE 0x08
|
||||||
|
|
||||||
#define ORE_RANGE_ACTUAL 1
|
|
||||||
#define ORE_RANGE_MIRROR 2
|
|
||||||
|
|
||||||
enum OreType {
|
enum OreType {
|
||||||
ORE_SCATTER,
|
ORE_SCATTER,
|
||||||
ORE_SHEET,
|
ORE_SHEET,
|
||||||
|
Loading…
Reference in New Issue
Block a user