otterminetest / OtterClient

Minetest 5.9.0 Cheat Client
Other
5 stars 3 forks source link

get_objects_inside_radius causes the game to crash #6

Open cowingtonpost1 opened 4 months ago

cowingtonpost1 commented 4 months ago

Minetest version

Minetest 5.9.0-dev-1921869f5 (Linux)
Using LuaJIT 2.1.1710398010
Built by GCC 13.2
Running on Linux/6.9.1-0-edge x86_64
BUILD_TYPE=Release
RUN_IN_PLACE=1
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="."
STATIC_LOCALEDIR="locale"

Irrlicht device

SDL

Operating system and version

Alpine Linux edge

CPU model

No response

GPU model

No response

Active renderer

No response

Summary

Access denied. Reason: Lua: Runtime error from mod '*builtin*' in callback environment_step(): testmod:init.lua:2: bad argument #6 to 'get_objects_inside_radius' (table expected, got nil)
stack traceback:
    [C]: in function 'get_objects_inside_radius'
    testmod:init.lua:2: in function <testmod:init.lua:1>
    *builtin*:client/register.lua:25: in function <*builtin*:client/register.lua:13>

Steps to reproduce

minetest.register_globalstep(function ()
   local obs = minetest.get_objects_inside_radius(minetest.localplayer:get_pos(), 10)
   print(dump(obs))
end)
otterminetest commented 4 months ago

looks like I haven't implemented get_objects_inside_radius correctly. Thanks for bringing this issue to my attention. It'll take some time for me to fully implement this as it depends on core.object_refs / minetest.object_refs. Also, implementing this feature isn't on my priority list - there're some features I'm currently working on. Could you let me know what your use case for this lua api is? There might be a better way to implement what you're trying to do instead of getting objects on globalstep.

cowingtonpost1 commented 4 months ago

thanks for getting back to me, i'm trying to get the dragonfire auto fish mod to work

otterminetest commented 4 months ago

I don't have the source for the mod could you send it here?

cowingtonpost1 commented 4 months ago

https://github.com/dragonfireclient/fishbot it depends on https://github.com/dragonfireclient/wasplib

otterminetest commented 4 months ago

I see. Thanks for sending that. Yea, it'll take me bit to fix get_objects_inside_radius but I'll update the issue here once I get that working.