summaryrefslogtreecommitdiff
path: root/src/mapgen.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-07-30 23:33:57 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-07-30 23:33:57 +0300
commit8e1eacf3a87a0cee39c8c27c3846828c12e73f9d (patch)
tree0863d9782fa44d73ae25867aba1edacae6f15252 /src/mapgen.cpp
parent4ccc99b291d7aa9ccb3e3c56f9d63bf30e02b0b9 (diff)
downloadminetest-8e1eacf3a87a0cee39c8c27c3846828c12e73f9d.tar.gz
minetest-8e1eacf3a87a0cee39c8c27c3846828c12e73f9d.tar.bz2
minetest-8e1eacf3a87a0cee39c8c27c3846828c12e73f9d.zip
Fixed handling of inventory in creative mode (normal inventory is not trashed anymore), fixed mese pick speed, added some forgotten stuff
Diffstat (limited to 'src/mapgen.cpp')
-rw-r--r--src/mapgen.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp
index 0ba7f91ab..5dec7d843 100644
--- a/src/mapgen.cpp
+++ b/src/mapgen.cpp
@@ -976,6 +976,40 @@ static void make_dungeon1(VoxelManipulator &vmanip, PseudoRandom &random)
}
}
+static void make_nc(VoxelManipulator &vmanip, PseudoRandom &random)
+{
+ v3s16 dir;
+ u8 facedir_i = 0;
+ s32 r = random.range(0, 3);
+ if(r == 0){
+ dir = v3s16( 1, 0, 0);
+ facedir_i = 3;
+ }
+ if(r == 1){
+ dir = v3s16(-1, 0, 0);
+ facedir_i = 1;
+ }
+ if(r == 2){
+ dir = v3s16( 0, 0, 1);
+ facedir_i = 2;
+ }
+ if(r == 3){
+ dir = v3s16( 0, 0,-1);
+ facedir_i = 0;
+ }
+ v3s16 p = vmanip.m_area.MinEdge + v3s16(
+ 16+random.range(0,15),
+ 16+random.range(0,15),
+ 16+random.range(0,15));
+ vmanip.m_data[vmanip.m_area.index(p)] = MapNode(CONTENT_NC, facedir_i);
+ u32 length = random.range(3,15);
+ for(u32 j=0; j<length; j++)
+ {
+ p -= dir;
+ vmanip.m_data[vmanip.m_area.index(p)] = MapNode(CONTENT_NC_RB);
+ }
+}
+
/*
Noise functions. Make sure seed is mangled differently in each one.
*/
@@ -1871,6 +1905,17 @@ void make_block(BlockMakeData *data)
}
}
}
+
+ /*
+ Add NC
+ */
+ {
+ PseudoRandom ncrandom(blockseed+9324342);
+ if(ncrandom.range(0, 1000) == 0 && blockpos.Y <= -3)
+ {
+ make_nc(vmanip, ncrandom);
+ }
+ }
/*
Add top and bottom side of water to transforming_liquid queue