diff options
author | Perttu Ahola <celeron55@gmail.com> | 2010-12-25 23:23:53 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2010-12-25 23:23:53 +0200 |
commit | 822621f79239fadd232243a38120b4673efe60fe (patch) | |
tree | 35b0f77cabcb8ce39eb0a87efa144959725e8991 /src/map.cpp | |
parent | 07a759fdb8c3239aabb271cbd24e8b24b2dee435 (diff) | |
download | minetest-822621f79239fadd232243a38120b4673efe60fe.tar.gz minetest-822621f79239fadd232243a38120b4673efe60fe.tar.bz2 minetest-822621f79239fadd232243a38120b4673efe60fe.zip |
some... stuff. dunno. 8-)
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/map.cpp b/src/map.cpp index 9a23863d5..59053f70c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1829,8 +1829,11 @@ MapBlock * ServerMap::emergeBlock( MapBlock has a tunnel ended in its side */ - v3f orp; - s16 ors; + v3f orp( + (float)(rand()%ued)+0.5, + (float)(rand()%ued)+0.5, + (float)(rand()%ued)+0.5 + ); // Check z- try @@ -1843,7 +1846,7 @@ MapBlock * ServerMap::emergeBlock( if(getNode(ap).d == CONTENT_AIR) { orp = v3f(x+1,y+1,0); - ors = 4; + goto continue_generating; } } } @@ -1860,7 +1863,7 @@ MapBlock * ServerMap::emergeBlock( if(getNode(ap).d == CONTENT_AIR) { orp = v3f(x+1,y+1,ued-1); - ors = 4; + goto continue_generating; } } } @@ -1877,7 +1880,7 @@ MapBlock * ServerMap::emergeBlock( if(getNode(ap).d == CONTENT_AIR) { orp = v3f(0,y+1,z+1); - ors = 4; + goto continue_generating; } } } @@ -1894,11 +1897,13 @@ MapBlock * ServerMap::emergeBlock( if(getNode(ap).d == CONTENT_AIR) { orp = v3f(ued-1,y+1,z+1); - ors = 4; + goto continue_generating; } } } catch(InvalidPositionException &e){} + +continue_generating: /* Generate some tunnel starting from orp and ors @@ -1906,9 +1911,9 @@ MapBlock * ServerMap::emergeBlock( for(u16 i=0; i<3; i++) { v3f rp( - (float)(rand()%(ued-1))+0.5, - (float)(rand()%(ued-1))+0.5, - (float)(rand()%(ued-1))+0.5 + (float)(rand()%ued)+0.5, + (float)(rand()%ued)+0.5, + (float)(rand()%ued)+0.5 ); s16 min_d = 0; s16 max_d = 4; @@ -1943,7 +1948,6 @@ MapBlock * ServerMap::emergeBlock( } orp = rp; - ors = rs; } } |