mirror of
https://github.com/minetest/minetest.git
synced 2024-12-24 15:12:23 +01:00
Cavegen: fix division by 0 with abnormal max tunnel diameter sizes
This commit is contained in:
parent
f764297be2
commit
30d6d4c733
@ -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)
|
//(this should be more than the maximum radius of the tunnel)
|
||||||
const s16 max_spread_amount = MAP_BLOCKSIZE;
|
const s16 max_spread_amount = MAP_BLOCKSIZE;
|
||||||
s16 insure = 10;
|
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;
|
ar += v3s16(1,0,1) * more * 2;
|
||||||
of -= v3s16(1,0,1) * more;
|
of -= v3s16(1,0,1) * more;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user