]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Add minetest.get_nearby_objects
authorElias Fleckenstein <eliasfleckenstein@web.de>
Thu, 7 Jan 2021 15:04:06 +0000 (16:04 +0100)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Thu, 7 Jan 2021 15:04:06 +0000 (16:04 +0100)
builtin/client/util.lua
doc/client_lua_api.txt

index e85727436a42900ee53f12516e663e91becf50f3..aea15e00ff59dc83789d203c4f28fb5f2d123f98 100644 (file)
@@ -54,3 +54,7 @@ end
 function core.close_formspec(formname)
        return core.show_formspec(formname, "")
 end
+
+function core.get_nearby_objects(radius)
+       return core.get_objects_inside_radius(core.localplayer:get_pos(), radius)
+end
index c7bbe160981e23c4d0391d603513fee5cd0f43c9..94d40fe2a63898ec4019f3377b29813a32c30722 100644 (file)
@@ -934,6 +934,8 @@ Call these functions only at load time!
 * `minetest.get_objects_inside_radius(pos, radius)`: returns a list of
   ClientObjectRefs.
     * `radius`: using an euclidean metric
+* `minetest.get_nearby_objects(radius)`
+    * alias for minetest.get_objects_inside_radius(minetest.localplayer:get_pos(), radius)
 * `minetest.disconnect()`
     * Disconnect from the server and exit to main menu.
     * Returns `false` if the client is already disconnecting otherwise returns `true`.