Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
illuna-minetest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
illuna-minetest
Commits
9a4ef878
Commit
9a4ef878
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Remove no-op mapgen::add_random_objects
parent
a57f4c23
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mapgen.cpp
+0
-69
0 additions, 69 deletions
src/mapgen.cpp
src/mapgen.h
+0
-4
0 additions, 4 deletions
src/mapgen.h
with
0 additions
and
73 deletions
src/mapgen.cpp
+
0
−
69
View file @
9a4ef878
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
src/mapgen.h
+
0
−
4
View file @
9a4ef878
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment