projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
650d706
)
Ensure ore can fit in OreSheet::generate()
author
kwolekr
<kwolekr@minetest.net>
Mon, 25 Mar 2013 00:19:29 +0000
(20:19 -0400)
committer
kwolekr
<kwolekr@minetest.net>
Mon, 25 Mar 2013 00:19:59 +0000
(20:19 -0400)
src/mapgen.cpp
patch
|
blob
|
history
diff --git
a/src/mapgen.cpp
b/src/mapgen.cpp
index 53b5d68679ecc07f18afecf599bb68aa6ce8dda4..689ad63cbe5ab66364f474d8fc669aae217c2035 100644
(file)
--- a/
src/mapgen.cpp
+++ b/
src/mapgen.cpp
@@
-141,8
+141,10
@@
void OreSheet::generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
PseudoRandom pr(blockseed + 4234);
int ymin = MYMAX(nmin.Y, height_min);
- int ymax = MYMIN(nmax.Y, height_max);
-
+ int ymax = MYMIN(nmax.Y, height_max);
+ if (clust_size >= ymax - ymin + 1)
+ return;
+
int x0 = nmin.X;
int z0 = nmin.Z;
@@
-150,7
+152,6
@@
void OreSheet::generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
int z1 = nmax.Z;
int max_height = clust_size;
-
int y_start = pr.range(ymin, ymax - max_height);
if (!noise) {