SmallJoker / boost_cart

The original version of minetest_game's carts (since 2018).
15 stars 14 forks source link

Nil value errors #23

Closed redblade7 closed 6 years ago

redblade7 commented 6 years ago

Hi,

After updating the mods on my server on 1/8/2018, I have occasional crashes with boost_cart with messages like:

ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'boost_cart' in callback luaentity_Step(): (REDACTED)/bin/../builtin/common/vector.lua:44: attempt to index local 'v' (a nil value) 2018-01-14 08:41:04: ERROR[Main]: stack traceback: 2018-01-14 08:41:04: ERROR[Main]: (REDACTED)/bin/../builtin/common/vector.lua:44: in function 'round' 2018-01-14 08:41:04: ERROR[Main]: (REDACTED)/games/minetest_game/mods/boost_cart/cart_entity.lua:310: in function (REDACTED)/games/minetest_game/mods/boost_cart/cart_entity.lua:153>

If it helps, I get the following message upon starting up the server (though it starts properly afterward):

WARNING[Server]: Undeclared global variable "player_api" accessed at (REDACTED)/bin/../games/minetest_game/mods/boost_cart/init.lua:29

If it helps, myself and others were having similar messages/crashes with mobs_redo, which was fixed with this commit: https://github.com/tenplus1/mobs_redo/commit/331c4e96d24ad1ca05d248b9716df6b653f8c46d

Note that the bug would have to have been introduced between 8/15/2017 and 1/8/2018.

Thank you!

SmallJoker commented 6 years ago

That's a very interesting edge case you've found here. It only happens when there's a cart moving very slowly, being deactivated before it stops and without that get_staticdata was ever called. Very strange.

However, the warning and the error should now be gone in f4c1a2e.