Noise: Prevent unittest crash caused by division by zero
[oweals/minetest.git] / src / mapgen_fractal.cpp
index 13da2f18012e8946978d7e058da3d869cbdeb0ef..720408dbb68d10995a5d308dc3dd2c4cff4e811f 100644 (file)
@@ -156,7 +156,8 @@ int MapgenFractal::getSpawnLevelAtPoint(v2s16 p)
                        air_count = 0;
                } else if (solid_below) {  // Air above solid node
                        air_count++;
-                       if (air_count == 2)
+                       // 3 to account for snowblock dust
+                       if (air_count == 3)
                                return y - 2;
                }
        }