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
1f53ca5f
Commit
1f53ca5f
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
Modify CONTENT_AIR and CONTENT_IGNORE handling in nodedef.cpp
parent
425db289
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/nodedef.cpp
+14
-2
14 additions, 2 deletions
src/nodedef.cpp
with
14 additions
and
2 deletions
src/nodedef.cpp
+
14
−
2
View file @
1f53ca5f
...
...
@@ -330,7 +330,10 @@ class CNodeDefManager: public IWritableNodeDefManager
f
.
diggable
=
false
;
f
.
buildable_to
=
true
;
f
.
air_equivalent
=
true
;
set
(
CONTENT_AIR
,
f
);
// Insert directly into containers
content_t
c
=
CONTENT_AIR
;
m_content_features
[
c
]
=
f
;
m_name_id_mapping
.
set
(
c
,
f
.
name
);
}
// Set CONTENT_IGNORE
{
...
...
@@ -346,7 +349,10 @@ class CNodeDefManager: public IWritableNodeDefManager
// A way to remove accidental CONTENT_IGNOREs
f
.
buildable_to
=
true
;
f
.
air_equivalent
=
true
;
set
(
CONTENT_IGNORE
,
f
);
// Insert directly into containers
content_t
c
=
CONTENT_IGNORE
;
m_content_features
[
c
]
=
f
;
m_name_id_mapping
.
set
(
c
,
f
.
name
);
}
}
// CONTENT_IGNORE = not found
...
...
@@ -415,6 +421,12 @@ class CNodeDefManager: public IWritableNodeDefManager
infostream
<<
"registerNode: registering content id
\"
"
<<
c
<<
"
\"
: name=
\"
"
<<
def
.
name
<<
"
\"
"
<<
std
::
endl
;
assert
(
c
<=
MAX_CONTENT
);
// Don't allow redefining CONTENT_IGNORE (but allow air)
if
(
def
.
name
==
"ignore"
||
c
==
CONTENT_IGNORE
){
infostream
<<
"registerNode: WARNING: Ignoring "
<<
"CONTENT_IGNORE redefinition"
<<
std
::
endl
;
return
;
}
// Check that the special contents are not redefined as different id
// because it would mess up everything
if
((
def
.
name
==
"ignore"
&&
c
!=
CONTENT_IGNORE
)
||
...
...
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