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
4d20f128
Commit
4d20f128
authored
13 years ago
by
Nils Dagsson Moskopp
Browse files
Options
Downloads
Patches
Plain Diff
* fix automerge regression
parent
0a38e542
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/environment.cpp
+5
-73
5 additions, 73 deletions
src/environment.cpp
with
5 additions
and
73 deletions
src/environment.cpp
+
5
−
73
View file @
4d20f128
...
@@ -594,7 +594,7 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime)
...
@@ -594,7 +594,7 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime)
block
->
setTimestamp
(
m_game_time
);
block
->
setTimestamp
(
m_game_time
);
//dstream<<"Block is "<<dtime_s<<" seconds old."<<std::endl;
//dstream<<"Block is "<<dtime_s<<" seconds old."<<std::endl;
// Activate stored objects
// Activate stored objects
activateObjects
(
block
);
activateObjects
(
block
);
...
@@ -612,7 +612,7 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime)
...
@@ -612,7 +612,7 @@ void ServerEnvironment::activateBlock(MapBlock *block, u32 additional_dtime)
// TODO: Do something
// TODO: Do something
// TODO: Implement usage of ActiveBlockModifier
// TODO: Implement usage of ActiveBlockModifier
// Here's a quick demonstration
// Here's a quick demonstration
v3s16
p0
;
v3s16
p0
;
for
(
p0
.
X
=
0
;
p0
.
X
<
MAP_BLOCKSIZE
;
p0
.
X
++
)
for
(
p0
.
X
=
0
;
p0
.
X
<
MAP_BLOCKSIZE
;
p0
.
X
++
)
...
@@ -748,8 +748,8 @@ void ServerEnvironment::step(float dtime)
...
@@ -748,8 +748,8 @@ void ServerEnvironment::step(float dtime)
MapBlock
*
block
=
m_map
->
getBlockNoCreateNoEx
(
p
);
MapBlock
*
block
=
m_map
->
getBlockNoCreateNoEx
(
p
);
if
(
block
==
NULL
)
if
(
block
==
NULL
)
continue
;
continue
;
// Set current time as timestamp (and let it set ChangedFlag)
// Set current time as timestamp (and let it set ChangedFlag)
block
->
setTimestamp
(
m_game_time
);
block
->
setTimestamp
(
m_game_time
);
}
}
...
@@ -770,75 +770,7 @@ void ServerEnvironment::step(float dtime)
...
@@ -770,75 +770,7 @@ void ServerEnvironment::step(float dtime)
if
(
block
==
NULL
)
if
(
block
==
NULL
)
continue
;
continue
;
// Get time difference
activateBlock
(
block
);
u32
dtime_s
=
0
;
u32
stamp
=
block
->
getTimestamp
();
if
(
m_game_time
>
stamp
&&
stamp
!=
BLOCK_TIMESTAMP_UNDEFINED
)
dtime_s
=
m_game_time
-
block
->
getTimestamp
();
// Set current time as timestamp (and let it set ChangedFlag)
block
->
setTimestamp
(
m_game_time
);
//dstream<<"Block is "<<dtime_s<<" seconds old."<<std::endl;
// Activate stored objects
activateObjects
(
block
);
// Run node metadata
bool
changed
=
block
->
m_node_metadata
.
step
((
float
)
dtime_s
);
if
(
changed
)
{
MapEditEvent
event
;
event
.
type
=
MEET_BLOCK_NODE_METADATA_CHANGED
;
event
.
p
=
p
;
m_map
->
dispatchEvent
(
&
event
);
block
->
setChangedFlag
();
}
// TODO: Do something
// TODO: Implement usage of ActiveBlockModifier
// Here's a quick demonstration
v3s16
p0
;
for
(
p0
.
X
=
0
;
p0
.
X
<
MAP_BLOCKSIZE
;
p0
.
X
++
)
for
(
p0
.
Y
=
0
;
p0
.
Y
<
MAP_BLOCKSIZE
;
p0
.
Y
++
)
for
(
p0
.
Z
=
0
;
p0
.
Z
<
MAP_BLOCKSIZE
;
p0
.
Z
++
)
{
v3s16
p
=
p0
+
block
->
getPosRelative
();
MapNode
n
=
block
->
getNodeNoEx
(
p0
);
// Test something:
// Convert all mud under proper day lighting to grass
if
(
n
.
d
==
CONTENT_MUD
)
{
if
(
dtime_s
>
300
)
{
MapNode
n_top
=
block
->
getNodeNoEx
(
p0
+
v3s16
(
0
,
1
,
0
));
if
(
content_features
(
n_top
.
d
).
air_equivalent
&&
n_top
.
getLight
(
LIGHTBANK_DAY
)
>=
13
)
{
n
.
d
=
CONTENT_GRASS
;
m_map
->
addNodeWithEvent
(
p
,
n
);
}
}
}
/*
Convert grass into mud if under something else than air
*/
else
if
(
n
.
d
==
CONTENT_GRASS
)
{
//if(myrand()%20 == 0)
{
MapNode
n_top
=
block
->
getNodeNoEx
(
p0
+
v3s16
(
0
,
1
,
0
));
if
(
n_top
.
d
!=
CONTENT_AIR
&&
n_top
.
d
!=
CONTENT_IGNORE
)
{
n
.
d
=
CONTENT_MUD
;
m_map
->
addNodeWithEvent
(
p
,
n
);
}
}
}
}
}
}
}
}
...
@@ -954,8 +886,8 @@ void ServerEnvironment::step(float dtime)
...
@@ -954,8 +886,8 @@ void ServerEnvironment::step(float dtime)
n
.
d
=
CONTENT_MUD
;
n
.
d
=
CONTENT_MUD
;
m_map
->
addNodeWithEvent
(
p
,
n
);
m_map
->
addNodeWithEvent
(
p
,
n
);
}
}
}
}
}
}
}
}
}
}
}
}
...
...
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