Train Network for Players

by leeh

QoL and advanced functionality for players using trains for transport, including improved destination selection dialog and automated train calling.

Content
2 years ago
0.17 - 1.1
7.44K
Transportation

b attempt to index field 'vehicle' (a nil value) in tnp/action.lua:383 in version 0.9.4

4 years ago

536055.881 Error MainLoop.cpp:1195: Exception at tick 61329135: The mod Train Network for Players caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TrainNetworkForPlayers::on_gui_click (ID 1)
TrainNetworkForPlayers/tnp/action.lua:383: attempt to index field 'vehicle' (a nil value)
stack traceback:
TrainNetworkForPlayers/tnp/action.lua:383: in function 'tnp_action_stationselect_redispatch'
TrainNetworkForPlayers/tnp/event.lua:29: in function <TrainNetworkForPlayers/tnp/event.lua:17>
536055.881 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "The mod Train Network for Players caused a non-recoverable error.
Please report this error to the mod author.

Error while running event TrainNetworkForPlayers::on_gui_click (ID 1)
TrainNetworkForPlayers/tnp/action.lua:383: attempt to index field 'vehicle' (a nil value)
stack traceback:
TrainNetworkForPlayers/tnp/action.lua:383: in function 'tnp_action_stationselect_redispatch'
TrainNetworkForPlayers/tnp/event.lua:29: in function <TrainNetworkForPlayers/tnp/event.lua:17>"
536055.881 Info ServerMultiplayerManager.cpp:776: updateTick(61329135) changing state from(InGame) to(Failed)
536055.881 Quitting: multiplayer error.

looks like there is a "return" missing between line 380 and 381 in tnp/action.lua, cuz line 383 should not be called any more when line 380 is reached. Getting line 383 its own if-block might help as well. I didn't bother to look any further, sry.

4 years ago

Aye you're right, I've added the return statements and released 0.9.5/0.10.5 with that fixed. Thanks for digging into it.

Slightly curious how it managed to get into that state, as there's some logic to detect exiting a train thats supposed to close the GUI -- but at least it shouldn't crash now.

4 years ago

I can't remember any more than clicking fast, sry.

New response