Skip to content

Commit 3ab99b0

Browse files
committed
Fix find_nodes_in_area bug
1 parent 519333b commit 3ab99b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

world.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ function world.find_nodes_in_area(p1, p2, nodenames, grouped)
135135
for x = sx, ex do
136136
for y = sy, ey do
137137
for z = sz, ez do
138-
local hash = minetest.hash_node_position({x=x, y=y, z=z})
139-
local node = world.nodes[hash]
138+
local pos = {x=x, y=y, z=z}
139+
local node = minetest.get_node_or_nil(pos)
140140
if node and node.name and names[node.name] then
141141
if not results[node.name] then
142142
results[node.name] = {}
@@ -153,8 +153,8 @@ function world.find_nodes_in_area(p1, p2, nodenames, grouped)
153153
for x = sx, ex do
154154
for y = sy, ey do
155155
for z = sz, ez do
156-
local hash = minetest.hash_node_position({x=x, y=y, z=z})
157-
local node = world.nodes[hash]
156+
local pos = {x=x, y=y, z=z}
157+
local node = minetest.get_node_or_nil(pos)
158158
if node and node.name and names[node.name] then
159159
table.insert(positions, pos)
160160
if not counts[node.name] then

0 commit comments

Comments
 (0)