projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f764297
)
Cavegen: fix division by 0 with abnormal max tunnel diameter sizes
author
kwolekr
<kwolekr@minetest.net>
Sun, 23 Jun 2013 19:16:52 +0000
(15:16 -0400)
committer
kwolekr
<kwolekr@minetest.net>
Sun, 23 Jun 2013 19:16:52 +0000
(15:16 -0400)
src/cavegen.cpp
patch
|
blob
|
history
diff --git
a/src/cavegen.cpp
b/src/cavegen.cpp
index 01543252a718c99ba9bd4f30c9b2355779ad912f..8e6798586b38edc802502b55f5b79a0ed1a46fbd 100644
(file)
--- a/
src/cavegen.cpp
+++ b/
src/cavegen.cpp
@@
-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;