Remove no-op mapgen::add_random_objects
parent
a57f4c23d8
commit
9a4ef87859
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
@ -52,7 +49,6 @@ namespace mapgen
|
|||
bool get_have_sand(u64 seed, v2s16 p2d);
|
||||
double tree_amount_2d(u64 seed, v2s16 p);
|
||||
|
||||
|
||||
struct BlockMakeData
|
||||
{
|
||||
bool no_op;
|
||||
|
|
Loading…
Reference in New Issue