Trains copied with the Clipboard copy tool will crash the world if they
are immediately decoupled.
Moving/reversing the train sometimes avoids the crash.
Doesn't seem to affect trains manually coupled then decoupled.
Same effect if decoupled using Boardcom and manual punching:
(Boardcom)
2021-11-13 22:04:17: ERROR[Main]: ServerError: AsyncErr:
ServerThread::run Lua: Runtime error from mod '' in callback
on_playerReceiveFields():
/usr/share/minetest/builtin/common/misc_helpers.lua:480: table index is nil
2021-11-13 22:04:17: ERROR[Main]: stack traceback:
2021-11-13 22:04:17: ERROR[Main]:
/usr/share/minetest/builtin/common/misc_helpers.lua:480: in function 'copy'
2021-11-13 22:04:17: ERROR[Main]:
.../mt/.minetest/mods/advtrains/advtrains/trainlogic.lua:1171: in
function 'split_train_at_index'
2021-11-13 22:04:17: ERROR[Main]:
/home/mt/.minetest/mods/advtrains/advtrains/couple.lua:391: in function
'split_train_at_wagon'
2021-11-13 22:04:17: ERROR[Main]:
/home/mt/.minetest/mods/advtrains/advtrains/wagons.lua:1272: in function
'safe_decouple_wagon'
2021-11-13 22:04:17: ERROR[Main]:
/home/mt/.minetest/mods/advtrains/advtrains/wagons.lua:1056: in function
'handle_bordcom_fields'
2021-11-13 22:04:17: ERROR[Main]:
/home/mt/.minetest/mods/advtrains/advtrains/wagons.lua:1172: in function
</home/mt/.minetest/mods/advtrains/advtrains/wagons.lua:1105>
2021-11-13 22:04:17: ERROR[Main]:
/usr/share/minetest/builtin/game/register.lua:422: in function
</usr/share/minetest/builtin/game/register.lua:406>
(Punching)
2021-11-13 22:08:53: ERROR[Main]: ServerError: AsyncErr:
ServerThread::run Lua: Runtime error from mod '' in callback
luaentity_Punch():
/usr/share/minetest/builtin/common/misc_helpers.lua:480: table index is nil
2021-11-13 22:08:53: ERROR[Main]: stack traceback:
2021-11-13 22:08:53: ERROR[Main]:
/usr/share/minetest/builtin/common/misc_helpers.lua:480: in function 'copy'
2021-11-13 22:08:53: ERROR[Main]:
.../mt/.minetest/mods/advtrains/advtrains/trainlogic.lua:1171: in
function 'split_train_at_index'
2021-11-13 22:08:53: ERROR[Main]:
/home/mt/.minetest/mods/advtrains/advtrains/couple.lua:391: in function
'split_train_at_wagon'
2021-11-13 22:08:53: ERROR[Main]:
/home/mt/.minetest/mods/advtrains/advtrains/wagons.lua:1272: in function
'safe_decouple_wagon'
2021-11-13 22:08:53: ERROR[Main]:
/home/mt/.minetest/mods/advtrains/advtrains/couple.lua:421: in function
</home/mt/.minetest/mods/advtrains/advtrains/couple.lua:418>
Also found a similar error when using split_at_index() on the LF server
--> games/minetest/builtin/common/misc-helpers.lua:480: table index is nil
function in question is table.copy()
split_at_index() uses advtrains.split_train_at_index(), which has a
table.copy() function introduced in commit be2f37a
"Support different types of speed restrictions; add documentation"
Are trains given a default "speed_restrictions_t" table at all?
187@bugs.linux-forks.de writes:
> Also found a similar error when using split_at_index() on the LF server
>
> --> games/minetest/builtin/common/misc-helpers.lua:480: table index is nil
>
> function in question is table.copy()
>
> split_at_index() uses advtrains.split_train_at_index(), which has a
> table.copy() function introduced in commit be2f37a
In which situation does this happen exactly? How can I reproduce this?
Fixed in release 2.4.1
%close