aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGael-de-Sailly <gael.chretien@akeonet.com>2015-08-28 16:16:19 +0200
committerparamat <mat.gregory@virginmedia.com>2015-08-29 23:30:17 +0100
commit18973f9af196ca48abfca25e05d4b1a396fdd871 (patch)
tree448f8e1ef9051fc01361c414f60405c36bd5c4de /src
parent17b7b7c85fc4faca2180a0104ed457c3a8734627 (diff)
downloadminetest-18973f9af196ca48abfca25e05d4b1a396fdd871.tar.gz
minetest-18973f9af196ca48abfca25e05d4b1a396fdd871.tar.bz2
minetest-18973f9af196ca48abfca25e05d4b1a396fdd871.zip
Ores: change ore chance in clusters to better respect clust_num_ores for dense clusters
Diffstat (limited to 'src')
-rw-r--r--src/mg_ore.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mg_ore.cpp b/src/mg_ore.cpp
index a94d1d6d9..0d0f74bf5 100644
--- a/src/mg_ore.cpp
+++ b/src/mg_ore.cpp
@@ -132,7 +132,7 @@ void OreScatter::generate(MMVManip *vm, int mapseed, u32 blockseed,
(nmax.Y - nmin.Y + 1) *
(nmax.Z - nmin.Z + 1);
u32 csize = clust_size;
- u32 orechance = (csize * csize * csize) / clust_num_ores;
+ u32 cvolume = csize * csize * csize;
u32 nclusters = volume / clust_scarcity;
for (u32 i = 0; i != nclusters; i++) {
@@ -154,7 +154,7 @@ void OreScatter::generate(MMVManip *vm, int mapseed, u32 blockseed,
for (u32 z1 = 0; z1 != csize; z1++)
for (u32 y1 = 0; y1 != csize; y1++)
for (u32 x1 = 0; x1 != csize; x1++) {
- if (pr.range(1, orechance) != 1)
+ if (pr.range(1, cvolume) > clust_num_ores)
continue;
u32 i = vm->m_area.index(x0 + x1, y0 + y1, z0 + z1);