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
747bc408
Commit
747bc408
authored
11 years ago
by
kwolekr
Browse files
Options
Downloads
Patches
Plain Diff
Cavegen: Respect is_ground_content MapNode setting; fix some code formatting issues
parent
d19a69cd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/cavegen.cpp
+5
-3
5 additions, 3 deletions
src/cavegen.cpp
src/mapnode.cpp
+6
-5
6 additions, 5 deletions
src/mapnode.cpp
src/nodedef.cpp
+18
-17
18 additions, 17 deletions
src/nodedef.cpp
with
29 additions
and
25 deletions
src/cavegen.cpp
+
5
−
3
View file @
747bc408
...
...
@@ -236,6 +236,9 @@ void CaveV6::carveRoute(v3f vec, float f, bool randomize_xz) {
continue
;
u32
i
=
vm
->
m_area
.
index
(
p
);
content_t
c
=
vm
->
m_data
[
i
].
getContent
();
if
(
!
ndef
->
get
(
c
).
is_ground_content
)
continue
;
if
(
large_cave
)
{
int
full_ymin
=
node_min
.
Y
-
MAP_BLOCKSIZE
;
...
...
@@ -250,7 +253,6 @@ void CaveV6::carveRoute(v3f vec, float f, bool randomize_xz) {
}
}
else
{
// Don't replace air or water or lava or ignore
content_t
c
=
vm
->
m_data
[
i
].
getContent
();
if
(
c
==
CONTENT_IGNORE
||
c
==
CONTENT_AIR
||
c
==
c_water_source
||
c
==
c_lava_source
)
continue
;
...
...
@@ -530,8 +532,8 @@ void CaveV7::carveRoute(v3f vec, float f, bool randomize_xz, bool is_ravine) {
// Don't replace air, water, lava, or ice
content_t
c
=
vm
->
m_data
[
i
].
getContent
();
if
(
c
==
CONTENT_AIR
||
c
==
c_water_source
||
c
==
c_lava_source
||
c
==
c_ice
)
if
(
!
ndef
->
get
(
c
).
is_ground_content
||
c
==
CONTENT_AIR
||
c
==
c_water_source
||
c
==
c_lava_source
||
c
==
c_ice
)
continue
;
if
(
large_cave
)
{
...
...
This diff is collapsed.
Click to expand it.
src/mapnode.cpp
+
6
−
5
View file @
747bc408
...
...
@@ -383,8 +383,10 @@ u8 MapNode::getLevel(INodeDefManager *nodemgr) const
return
getParam2
()
&
LIQUID_LEVEL_MASK
;
if
(
f
.
leveled
||
f
.
param_type_2
==
CPT2_LEVELED
)
{
u8
level
=
getParam2
()
&
LEVELED_MASK
;
if
(
level
)
return
level
;
if
(
f
.
leveled
>
LEVELED_MAX
)
return
LEVELED_MAX
;
if
(
level
)
return
level
;
if
(
f
.
leveled
>
LEVELED_MAX
)
return
LEVELED_MAX
;
return
f
.
leveled
;
//default
}
return
0
;
...
...
@@ -398,7 +400,7 @@ u8 MapNode::setLevel(INodeDefManager *nodemgr, s8 level)
return
0
;
}
const
ContentFeatures
&
f
=
nodemgr
->
get
(
*
this
);
if
(
f
.
param_type_2
==
CPT2_FLOWINGLIQUID
if
(
f
.
param_type_2
==
CPT2_FLOWINGLIQUID
||
f
.
liquid_type
==
LIQUID_FLOWING
||
f
.
liquid_type
==
LIQUID_SOURCE
)
{
if
(
level
>=
LIQUID_LEVEL_SOURCE
)
{
...
...
@@ -487,8 +489,7 @@ void MapNode::deSerialize(u8 *source, u8 version)
param0
=
readU16
(
source
+
0
);
param1
=
readU8
(
source
+
2
);
param2
=
readU8
(
source
+
3
);
}
else
{
}
else
{
param0
=
readU8
(
source
+
0
);
param1
=
readU8
(
source
+
1
);
param2
=
readU8
(
source
+
2
);
...
...
This diff is collapsed.
Click to expand it.
src/nodedef.cpp
+
18
−
17
View file @
747bc408
...
...
@@ -396,15 +396,16 @@ class CNodeDefManager: public IWritableNodeDefManager
// Set CONTENT_AIR
{
ContentFeatures
f
;
f
.
name
=
"air"
;
f
.
drawtype
=
NDT_AIRLIKE
;
f
.
param_type
=
CPT_LIGHT
;
f
.
light_propagates
=
true
;
f
.
name
=
"air"
;
f
.
drawtype
=
NDT_AIRLIKE
;
f
.
param_type
=
CPT_LIGHT
;
f
.
light_propagates
=
true
;
f
.
sunlight_propagates
=
true
;
f
.
walkable
=
false
;
f
.
pointable
=
false
;
f
.
diggable
=
false
;
f
.
buildable_to
=
true
;
f
.
walkable
=
false
;
f
.
pointable
=
false
;
f
.
diggable
=
false
;
f
.
buildable_to
=
true
;
f
.
is_ground_content
=
true
;
// Insert directly into containers
content_t
c
=
CONTENT_AIR
;
m_content_features
[
c
]
=
f
;
...
...
@@ -414,16 +415,16 @@ class CNodeDefManager: public IWritableNodeDefManager
// Set CONTENT_IGNORE
{
ContentFeatures
f
;
f
.
name
=
"ignore"
;
f
.
drawtype
=
NDT_AIRLIKE
;
f
.
param_type
=
CPT_NONE
;
f
.
light_propagates
=
false
;
f
.
name
=
"ignore"
;
f
.
drawtype
=
NDT_AIRLIKE
;
f
.
param_type
=
CPT_NONE
;
f
.
light_propagates
=
false
;
f
.
sunlight_propagates
=
false
;
f
.
walkable
=
false
;
f
.
pointable
=
false
;
f
.
diggable
=
false
;
// A way to remove accidental CONTENT_IGNOREs
f
.
buildable_to
=
true
;
f
.
walkable
=
false
;
f
.
pointable
=
false
;
f
.
diggable
=
false
;
f
.
buildable_to
=
true
;
// A way to remove accidental CONTENT_IGNOREs
f
.
is_ground_content
=
true
;
// Insert directly into containers
content_t
c
=
CONTENT_IGNORE
;
m_content_features
[
c
]
=
f
;
...
...
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