aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-03-24 22:35:23 -0400
committerkwolekr <kwolekr@minetest.net>2013-03-24 22:35:23 -0400
commit26cad481d08432df1c9ace5f1ac23f1fad9a403f (patch)
tree23b4209d9643f859cbc9b2b9440cc797f3cfc1bd /src
parent8d13967aa3a802df8fa8d97fcce32fea2b46f2bf (diff)
downloadminetest-26cad481d08432df1c9ace5f1ac23f1fad9a403f.tar.gz
minetest-26cad481d08432df1c9ace5f1ac23f1fad9a403f.tar.bz2
minetest-26cad481d08432df1c9ace5f1ac23f1fad9a403f.zip
Vary ore sheet y position by noise
Diffstat (limited to 'src')
-rw-r--r--src/mapgen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 689ad63cb..b5deaae52 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -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);