Skip to content

Commit 30d6d4c

Browse files
committedJun 23, 2013
Cavegen: fix division by 0 with abnormal max tunnel diameter sizes
1 parent f764297 commit 30d6d4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/cavegen.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void CaveV6::makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height) {
7070
//(this should be more than the maximum radius of the tunnel)
7171
const s16 max_spread_amount = MAP_BLOCKSIZE;
7272
s16 insure = 10;
73-
s16 more = max_spread_amount - max_tunnel_diameter / 2 - insure;
73+
s16 more = MYMAX(max_spread_amount - max_tunnel_diameter / 2 - insure, 1);
7474
ar += v3s16(1,0,1) * more * 2;
7575
of -= v3s16(1,0,1) * more;
7676

0 commit comments

Comments
 (0)
Please sign in to comment.