summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <cheapiephp@gmail.com>2020-04-24 17:33:00 -0500
committerGitHub <noreply@github.com>2020-04-25 00:33:00 +0200
commitd3aedd2b987c966c35b6270206d2611879d94f52 (patch)
tree6a953ec5e63321c51e46ef5f9be6432752778862
parent68c17299907d850a2565ed7c162be142cc817473 (diff)
downloadmesecons-d3aedd2b987c966c35b6270206d2611879d94f52.tar
mesecons-d3aedd2b987c966c35b6270206d2611879d94f52.tar.gz
mesecons-d3aedd2b987c966c35b6270206d2611879d94f52.tar.bz2
mesecons-d3aedd2b987c966c35b6270206d2611879d94f52.tar.xz
mesecons-d3aedd2b987c966c35b6270206d2611879d94f52.zip
Speed up search for objects to be moved in MVPS (#512)
-rw-r--r--mesecons_mvps/init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesecons_mvps/init.lua b/mesecons_mvps/init.lua
index 807692e..3792d26 100644
--- a/mesecons_mvps/init.lua
+++ b/mesecons_mvps/init.lua
@@ -285,7 +285,7 @@ function mesecon.mvps_move_objects(pos, dir, nodestack, movefactor)
end
movefactor = movefactor or 1
dir = vector.multiply(dir, movefactor)
- for id, obj in pairs(minetest.object_refs) do
+ for id, obj in pairs(minetest.get_objects_inside_radius(pos, #nodestack + 1)) do
local obj_pos = obj:get_pos()
local cbox = obj:get_properties().collisionbox
local min_pos = vector.add(obj_pos, vector.new(cbox[1], cbox[2], cbox[3]))