diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-01-30 19:22:05 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-27 19:01:52 +0300 |
commit | 9a4ef878598bf05bd2e88e44592fe21ccdb0aec6 (patch) | |
tree | 72b2f292afc6a95efe59d63c1291bca5fa384704 /src | |
parent | a57f4c23d8fa490f2aef8bd2bc15d9d4e3a7dbd5 (diff) | |
download | minetest-9a4ef878598bf05bd2e88e44592fe21ccdb0aec6.tar.gz minetest-9a4ef878598bf05bd2e88e44592fe21ccdb0aec6.tar.bz2 minetest-9a4ef878598bf05bd2e88e44592fe21ccdb0aec6.zip |
Remove no-op mapgen::add_random_objects
Diffstat (limited to 'src')
-rw-r--r-- | src/mapgen.cpp | 69 | ||||
-rw-r--r-- | src/mapgen.h | 4 |
2 files changed, 0 insertions, 73 deletions
diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 5cab6eab9..56f814342 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1415,75 +1415,6 @@ bool get_have_sand(u64 seed, v2s16 p2d) return (sandnoise > -0.15); } -/* - Adds random objects to block, depending on the content of the block -*/ -void add_random_objects(MapBlock *block) -{ -#if 0 - for(s16 z0=0; z0<MAP_BLOCKSIZE; z0++) - for(s16 x0=0; x0<MAP_BLOCKSIZE; x0++) - { - bool last_node_walkable = false; - for(s16 y0=0; y0<MAP_BLOCKSIZE; y0++) - { - v3s16 p(x0,y0,z0); - MapNode n = block->getNodeNoEx(p); - if(n.getContent() == CONTENT_IGNORE) - continue; - if(data->nodedef->get(n)->liquid_type != LIQUID_NONE) - continue; - if(data->nodedef->get(n)->walkable) - { - last_node_walkable = true; - continue; - } - if(last_node_walkable) - { - // If block contains light information - if(content_features(n).param_type == CPT_LIGHT) - { - if(n.getLight(LIGHTBANK_DAY) <= 3) - { - if(myrand() % 300 == 0) - { - v3f pos_f = intToFloat(p+block->getPosRelative(), BS); - pos_f.Y -= BS*0.4; - ServerActiveObject *obj = new RatSAO(NULL, 0, pos_f); - std::string data = obj->getStaticData(); - StaticObject s_obj(obj->getType(), - obj->getBasePosition(), data); - // Add some - block->m_static_objects.insert(0, s_obj); - block->m_static_objects.insert(0, s_obj); - block->m_static_objects.insert(0, s_obj); - block->m_static_objects.insert(0, s_obj); - block->m_static_objects.insert(0, s_obj); - block->m_static_objects.insert(0, s_obj); - delete obj; - } - if(myrand() % 1000 == 0) - { - v3f pos_f = intToFloat(p+block->getPosRelative(), BS); - pos_f.Y -= BS*0.4; - ServerActiveObject *obj = new Oerkki1SAO(NULL,0,pos_f); - std::string data = obj->getStaticData(); - StaticObject s_obj(obj->getType(), - obj->getBasePosition(), data); - // Add one - block->m_static_objects.insert(0, s_obj); - delete obj; - } - } - } - } - last_node_walkable = false; - } - } - block->raiseModified(MOD_STATE_WRITE_NEEDED, "mapgen::add_random_objects"); -#endif -} - void make_block(BlockMakeData *data) { if(data->no_op) diff --git a/src/mapgen.h b/src/mapgen.h index 20eefea29..24a853bdc 100644 --- a/src/mapgen.h +++ b/src/mapgen.h @@ -39,9 +39,6 @@ namespace mapgen // Main map generation routine void make_block(BlockMakeData *data); - // Add objects according to block content - void add_random_objects(MapBlock *block); - // Add a tree void make_tree(ManualMapVoxelManipulator &vmanip, v3s16 p0, bool is_apple_tree, INodeDefManager *ndef); @@ -51,7 +48,6 @@ namespace mapgen */ bool get_have_sand(u64 seed, v2s16 p2d); double tree_amount_2d(u64 seed, v2s16 p); - struct BlockMakeData { |