orwell96 / advtrains

Minetest Mod: Advanced Trains
https://forum.minetest.net/viewtopic.php?f=11&t=14726
GNU Lesser General Public License v2.1
43 stars 13 forks source link

Crash after hopping on train #37

Closed gbl08ma closed 7 years ago

gbl08ma commented 7 years ago

After deleting all trains (to avoid issues like #34 ...), updating to 1.6.2, migrating all the tracks to the new database, creating a new subway train with two cars, hopping on it, after just a few blocks / seconds the following error occurred:

2017-02-04 22:04:21: ACTION[Server]: [advtrains]get_on: attaching singleplayer 
2017-02-04 22:04:22: ACTION[Server]: [advtrains]Limiting dtime to 0.2! 
2017-02-04 22:04:24: ERROR[Main]: ServerError: Runtime error from mod 'advtrains' in callback environment_Step(): ...e/gabriel/.minetest/mods/advtrains/advtrains/helpers.lua:143: attempt to index local 'vec' (a nil value)
2017-02-04 22:04:24: ERROR[Main]: stack traceback:
2017-02-04 22:04:24: ERROR[Main]:   ...e/gabriel/.minetest/mods/advtrains/advtrains/helpers.lua:143: in function 'round_vector_floor_y'
2017-02-04 22:04:24: ERROR[Main]:   ...e/gabriel/.minetest/mods/advtrains/advtrains/helpers.lua:58: in function 'conway'
2017-02-04 22:04:24: ERROR[Main]:   ...abriel/.minetest/mods/advtrains/advtrains/trainlogic.lua:285: in function 'train_step_a'
2017-02-04 22:04:24: ERROR[Main]:   ...abriel/.minetest/mods/advtrains/advtrains/trainlogic.lua:67: in function <...abriel/.minetest/mods/advtrains/advtrains/trainlogic.lua:43>
2017-02-04 22:04:24: ERROR[Main]:   /usr/share/minetest/builtin/game/register.lua:412: in function </usr/share/minetest/builtin/game/register.lua:392>
2017-02-04 22:04:24: ACTION[Server]: singleplayer leaves game. List of players: 

I reopened the world, the player was still attached to the train and moving forward just like before the crash, so I left the train and entered again, moved it forward like before, and the error didn't occur again (so far).

orwell96 commented 7 years ago

no idea. did never happen to me. If you can reproduce it, write this in lines 266 and 284 (outcomment the debug message and remove the pos_to_string calls):

266: atprint("maxn conway for ",maxn,path[maxn],maxn-1,path[maxn-1])
284: atprint("minn conway for ",minn,path[minn],minn+1,path[minn+1])

and provide the debug log

gbl08ma commented 7 years ago

I couldn't reproduce it yet. If it doesn't happen again in a few days I think this issue can be closed, it was probably just a random thing caused by the version upgrade. The problems with itrainmap I reported on the forum, though... should I open an issue, or am I doing something wrong?

orwell96 commented 7 years ago

Close it yourself when you think it's gone.

gbl08ma commented 7 years ago

I just put together two trains with 6 cars each, after much hopping on and off, I couldn't reproduce the error... let's assume it was DB migration shenanigans and forget this.