aboutsummaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2010-12-22 17:58:02 +0200
committerPerttu Ahola <celeron55@gmail.com>2010-12-22 17:58:02 +0200
commit58ccc68c81b62e3826a7367c38871324ce1eab86 (patch)
tree11645247bf3557692514f1fa46cfa6c8fa5b4065 /src/map.cpp
parent3de176cc587c4e0601c3c3f5a049e30db6bd2c17 (diff)
downloadminetest-58ccc68c81b62e3826a7367c38871324ce1eab86.tar.gz
minetest-58ccc68c81b62e3826a7367c38871324ce1eab86.tar.bz2
minetest-58ccc68c81b62e3826a7367c38871324ce1eab86.zip
server starting on port 0 on invalid settings
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 700312fb2..acaf8436a 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1950,6 +1950,10 @@ MapBlock * ServerMap::emergeBlock(
if(some_part_underground)
{
s16 underground_level = (lowest_ground_y/MAP_BLOCKSIZE - block_y)+1;
+
+ /*
+ Add meseblocks
+ */
for(s16 i=0; i<underground_level*1; i++)
{
if(rand()%2 == 0)
@@ -1978,9 +1982,16 @@ MapBlock * ServerMap::emergeBlock(
}
}
- if(rand()%3 == 0)
+ /*
+ Add coal
+ */
+ u16 coal_amount = 30.0 * g_settings.getFloat("coal_amount");
+ u16 coal_rareness = 60 / coal_amount;
+ if(coal_rareness == 0)
+ coal_rareness = 1;
+ if(rand()%coal_rareness == 0)
{
- for(s16 i=0; i<20; i++)
+ for(s16 i=0; i<coal_amount; i++)
{
v3s16 cp(
(rand()%(MAP_BLOCKSIZE-2))+1,
@@ -2157,22 +2168,26 @@ MapBlock * ServerMap::emergeBlock(
<<std::endl;*/
{
v3s16 p2 = p + v3s16(x,y,z-2);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n);
}
{
v3s16 p2 = p + v3s16(x,y,z-1);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n2);
}
{
v3s16 p2 = p + v3s16(x,y,z+0);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n2);
}
{
v3s16 p2 = p + v3s16(x,y,z+1);
- if(is_ground_content(sector->getNode(p2).d))
+ if(is_ground_content(sector->getNode(p2).d)
+ && !is_mineral(sector->getNode(p2).d))
sector->setNode(p2, n);
}