minetest-mods / xdecor

A decoration mod for Minetest meant to be light, simple and well-featured
Other
29 stars 46 forks source link

player callback error #92

Closed Sur3 closed 6 years ago

Sur3 commented 6 years ago

I had an error produced by xdecor:

2018-07-08 21:04:49: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'xdecor' in callback environment_Step(): .../minetest/games/minetest_game/mods/default/functions.lua:547: core.check_player_privs expects a player or playername as argument.
2018-07-08 21:04:49: ERROR[Main]: stack traceback:
2018-07-08 21:04:49: ERROR[Main]:       [C]: in function 'error'
2018-07-08 21:04:49: ERROR[Main]:       /usr/share/minetest/builtin/game/misc.lua:11: in function 'check_player_privs'
2018-07-08 21:04:49: ERROR[Main]:       .../minetest/games/minetest_game/mods/default/functions.lua:547: in function 'can_interact_with_node'
2018-07-08 21:04:49: ERROR[Main]:       /usr/share/minetest/games/minetest_game/mods/doors/init.lua:153: in function 'close'
2018-07-08 21:04:49: ERROR[Main]:       /var/lib/minetest/.minetest/mods/xdecor/src/mechanisms.lua:23: in function 'func'
2018-07-08 21:04:49: ERROR[Main]:       /usr/share/minetest/builtin/common/after.lua:18: in function </usr/share/minetest/builtin/common/after.lua:4>
2018-07-08 21:04:49: ERROR[Main]:       /usr/share/minetest/builtin/game/register.lua:420: in function </usr/share/minetest/builtin/game/register.lua:400>

(Also enchantment of swords seems not to work but I think that is an other issue..)

kilbith commented 6 years ago

@sofar Missing check in the doors mod I think.

SmallJoker commented 6 years ago

This issue could also be caused by using the ObjectRef player in door_toggle two seconds after the actual event. Meanwhile the player might already be invalid (left). https://github.com/minetest-mods/xdecor/blob/9b5bdc1b1a387e5f89fca850c6e52940c228ff6e/src/mechanisms.lua#L18-L24 EDIT: It's indeed that problem. xdecor supplies an invalid player object indirectly to core.check_player_privs

kilbith commented 6 years ago

Then it's better that the check for the object is added upstream.

Sur3 commented 6 years ago

I also had an other issue with some xdecor callback now, is that one related or a new issue?

2018-08-12 23:16:28: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'xdecor' in callback item_OnPlace(): /usr/share/minetest/builtin/common/misc_helpers.lua:650: attempt to perform arithmetic on a nil value 2018-08-12 23:16:28: ERROR[Main]: stack traceback: 2018-08-12 23:16:28: ERROR[Main]: /usr/share/minetest/builtin/common/misc_helpers.lua:650: in function 'pointed_thing_to_face_pos' 2018-08-12 23:16:28: ERROR[Main]: .../share/minetest/games/minetest_game/mods/stairs/init.lua:31: in function <.../share/minetest/games/minetest_game/mods/stairs/init.lua:20>

kilbith commented 6 years ago

Please open a new issue mentioning the item you placed prior to crashing.

Sur3 commented 6 years ago

Ok thanks, did that: https://github.com/minetest-mods/xdecor/issues/96