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
ff740a41
Commit
ff740a41
authored
9 years ago
by
kwolekr
Browse files
Options
Downloads
Patches
Plain Diff
Ensure that Map::findNodesWithMetadata() reports nodes strictly within the node-granular area
parent
f1ccfd3c
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/map.cpp
+9
-2
9 additions, 2 deletions
src/map.cpp
with
9 additions
and
2 deletions
src/map.cpp
+
9
−
2
View file @
ff740a41
...
@@ -1898,6 +1898,8 @@ std::vector<v3s16> Map::findNodesWithMetadata(v3s16 p1, v3s16 p2)
...
@@ -1898,6 +1898,8 @@ std::vector<v3s16> Map::findNodesWithMetadata(v3s16 p1, v3s16 p2)
v3s16
bpmin
=
getNodeBlockPos
(
p1
);
v3s16
bpmin
=
getNodeBlockPos
(
p1
);
v3s16
bpmax
=
getNodeBlockPos
(
p2
);
v3s16
bpmax
=
getNodeBlockPos
(
p2
);
VoxelArea
area
(
p1
,
p2
);
for
(
s16
z
=
bpmin
.
Z
;
z
<=
bpmax
.
Z
;
z
++
)
for
(
s16
z
=
bpmin
.
Z
;
z
<=
bpmax
.
Z
;
z
++
)
for
(
s16
y
=
bpmin
.
Y
;
y
<=
bpmax
.
Y
;
y
++
)
for
(
s16
y
=
bpmin
.
Y
;
y
<=
bpmax
.
Y
;
y
++
)
for
(
s16
x
=
bpmin
.
X
;
x
<=
bpmax
.
X
;
x
++
)
{
for
(
s16
x
=
bpmin
.
X
;
x
<=
bpmax
.
X
;
x
++
)
{
...
@@ -1917,8 +1919,13 @@ std::vector<v3s16> Map::findNodesWithMetadata(v3s16 p1, v3s16 p2)
...
@@ -1917,8 +1919,13 @@ std::vector<v3s16> Map::findNodesWithMetadata(v3s16 p1, v3s16 p2)
v3s16
p_base
=
blockpos
*
MAP_BLOCKSIZE
;
v3s16
p_base
=
blockpos
*
MAP_BLOCKSIZE
;
std
::
vector
<
v3s16
>
keys
=
block
->
m_node_metadata
.
getAllKeys
();
std
::
vector
<
v3s16
>
keys
=
block
->
m_node_metadata
.
getAllKeys
();
for
(
size_t
i
=
0
;
i
!=
keys
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
!=
keys
.
size
();
i
++
)
{
positions_with_meta
.
push_back
(
keys
[
i
]
+
p_base
);
v3s16
p
(
keys
[
i
]
+
p_base
);
if
(
!
area
.
contains
(
p
))
continue
;
positions_with_meta
.
push_back
(
p
);
}
}
}
return
positions_with_meta
;
return
positions_with_meta
;
...
...
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