After a crash are trains still stopping in an overlapped state.
This very old bug was many times reported, because sometimes the only
way to solve it way the destruction of ine of the trains.
If I remember right it was announced that with the new TSS version of
advtrains this problem would be removed / solved.
See also #111.
A simple way to fix this would be by forcing the train to stand back when it collides:
--- 8a Check collision ---
if not collided then
local col_tr = advtrains.occ.check_collision(testpos, id)
if col_tr then
train.velocity = 0
collided = true
-- Now, we need to move the train so that they don't overlap (#112)
-- The testing result appears to be quite funny if you keep on
-- pressing "W", but at least we have solved the problem.
train.index = train.index - 1
-- Now, shunt the trains if in shunt mode
if train.is_shunt or col_tr.is_shunt then
train.is_shunt = nil
col_tr.is_shunt = nil
minetest.after(0,advtrains.do_connect_trains, col_tr.id, train.id, train.velocity)
This is what I get (I slightly modified the HUD but I think the most important things are still shown): https://imgur.com/a/swJM2n8
Fixed by 1f3a4c3b
Problem still occurs for trains that are not on the same track, but this case is rare and there's no elegant way to handle this.