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
eabfb370
Commit
eabfb370
authored
13 years ago
by
Perttu Ahola
Browse files
Options
Downloads
Patches
Plain Diff
MapNode constructor to allow ndef+name
parent
62164d95
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mapnode.cpp
+14
-0
14 additions, 0 deletions
src/mapnode.cpp
src/mapnode.h
+5
-0
5 additions, 0 deletions
src/mapnode.h
with
19 additions
and
0 deletions
src/mapnode.cpp
+
14
−
0
View file @
eabfb370
...
...
@@ -155,6 +155,20 @@ v3s16 unpackDir(u8 b)
MapNode
*/
// Create directly from a nodename
// If name is unknown, sets CONTENT_IGNORE
MapNode
::
MapNode
(
INodeDefManager
*
ndef
,
const
std
::
string
&
name
,
u8
a_param1
,
u8
a_param2
)
{
content_t
id
=
CONTENT_IGNORE
;
ndef
->
getId
(
name
,
id
);
param1
=
a_param1
;
param2
=
a_param2
;
// Set content (param0 and (param2&0xf0)) after other params
// because this needs to override part of param2
setContent
(
id
);
}
void
MapNode
::
setLight
(
enum
LightBank
bank
,
u8
a_light
,
INodeDefManager
*
nodemgr
)
{
// If node doesn't contain light data, ignore this
...
...
This diff is collapsed.
Click to expand it.
src/mapnode.h
+
5
−
0
View file @
eabfb370
...
...
@@ -147,6 +147,11 @@ struct MapNode
// because this needs to override part of param2
setContent
(
content
);
}
// Create directly from a nodename
// If name is unknown, sets CONTENT_IGNORE
MapNode
(
INodeDefManager
*
ndef
,
const
std
::
string
&
name
,
u8
a_param1
=
0
,
u8
a_param2
=
0
);
bool
operator
==
(
const
MapNode
&
other
)
{
...
...
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