Skip to content

Commit

Permalink
Cavegen: fix division by 0 with abnormal max tunnel diameter sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
kwolekr committed Jun 23, 2013
1 parent f764297 commit 30d6d4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cavegen.cpp
Expand Up @@ -70,7 +70,7 @@ void CaveV6::makeCave(v3s16 nmin, v3s16 nmax, int max_stone_height) {
//(this should be more than the maximum radius of the tunnel)
const s16 max_spread_amount = MAP_BLOCKSIZE;
s16 insure = 10;
s16 more = max_spread_amount - max_tunnel_diameter / 2 - insure;
s16 more = MYMAX(max_spread_amount - max_tunnel_diameter / 2 - insure, 1);
ar += v3s16(1,0,1) * more * 2;
of -= v3s16(1,0,1) * more;

Expand Down

0 comments on commit 30d6d4c

Please sign in to comment.