Skip to content
Snippets Groups Projects
Commit 8d13967a authored by kwolekr's avatar kwolekr
Browse files

Ensure ore can fit in OreSheet::generate()

parent 650d706d
No related branches found
No related tags found
No related merge requests found
...@@ -141,8 +141,10 @@ void OreSheet::generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { ...@@ -141,8 +141,10 @@ void OreSheet::generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
PseudoRandom pr(blockseed + 4234); PseudoRandom pr(blockseed + 4234);
int ymin = MYMAX(nmin.Y, height_min); 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 x0 = nmin.X;
int z0 = nmin.Z; int z0 = nmin.Z;
...@@ -150,7 +152,6 @@ void OreSheet::generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) { ...@@ -150,7 +152,6 @@ void OreSheet::generate(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) {
int z1 = nmax.Z; int z1 = nmax.Z;
int max_height = clust_size; int max_height = clust_size;
int y_start = pr.range(ymin, ymax - max_height); int y_start = pr.range(ymin, ymax - max_height);
if (!noise) { if (!noise) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment