From: Perttu Ahola Date: Mon, 30 Jan 2012 17:22:05 +0000 (+0200) Subject: Remove no-op mapgen::add_random_objects X-Git-Tag: 0.4.dev-20120408~119 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9a4ef878598bf05bd2e88e44592fe21ccdb0aec6;p=oweals%2Fminetest.git Remove no-op mapgen::add_random_objects --- 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; z0getNodeNoEx(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 {