mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Vary ore sheet y position by noise
This commit is contained in:
parent
8d13967aa3
commit
26cad481d0
2 changed files with 9 additions and 6 deletions
|
@ -165,12 +165,12 @@ void OreSheet::generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
|
|||
int index = 0;
|
||||
for (int z = z0; z != z1; z++)
|
||||
for (int x = x0; x != x1; x++) {
|
||||
|
||||
if (noise->result[index++] < nthresh)
|
||||
float noiseval = noise->result[index++];
|
||||
if (noiseval < nthresh)
|
||||
continue;
|
||||
|
||||
int height = max_height * (1. / pr.range(1, 3));
|
||||
int y0 = y_start + pr.range(1, 3) - 1;
|
||||
int y0 = y_start + np->scale * noiseval; //pr.range(1, 3) - 1;
|
||||
int y1 = y0 + height;
|
||||
for (int y = y0; y != y1; y++) {
|
||||
u32 i = vm->m_area.index(x, y, z);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue