Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime error from mod 'animalia' in callback luaentity_Step(): .../_minetest/.minetest/mods/animalia/api/behaviors.lua:530: bad argument #2 to 'random' (interval is empty) #60

Open
Yonle opened this issue Jul 29, 2023 · 3 comments · May be fixed by #61

Comments

@Yonle
Copy link

Yonle commented Jul 29, 2023

Minetest v5.6.0 server.

@Yonle
Copy link
Author

Yonle commented Jul 29, 2023

2023-07-29 22:07:06: ACTION[Main]: Server: Shutting down
2023-07-29 22:07:06: ACTION[Main]: IRC: Disconnected.

2023-07-29 22:07:06: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'animalia' in callback luaentity_Step(): .../_minetest/.minetest/mods/animalia/api/behaviors.lua:530: bad argument #2 to 'random' (interval is empty)
2023-07-29 22:07:06: ERROR[Main]: stack traceback:
2023-07-29 22:07:06: ERROR[Main]:       [C]: in function 'random'             
2023-07-29 22:07:06: ERROR[Main]:       .../_minetest/.minetest/mods/animalia/api/behaviors.lua:530: in function 'action_wander_walk'

2023-07-29 22:07:06: ERROR[Main]:       .../_minetest/.minetest/mods/animalia/api/behaviors.lua:891: in function 'func'                                     
2023-07-29 22:07:06: ERROR[Main]:       /home/_minetest/.minetest/mods/creatura/mob_meta.lua:1184: in function '_execute_utilities'                         
2023-07-29 22:07:06: ERROR[Main]:       /home/_minetest/.minetest/mods/creatura/mob_meta.lua:937: in function </home/_minetest/.minetest/mods/creatura/mob_meta.lua:902>

@BobOmbuzal
Copy link

BobOmbuzal commented Aug 14, 2023

I also get this (Server v5.7.0)
(as soon as i join the server)

@cheapie
Copy link

cheapie commented Aug 18, 2023

It appears that LuaJIT tolerates the second argument to math.random() being lower than the first, but plain Lua does not. I'm not familiar enough with this mod to say for sure if "width" is positive here or not, but if it is, perhaps this is why it crashes for some users but not others.

@appgurueu appgurueu linked a pull request Aug 18, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants