Hemiptera Bugtracker at bugs.linux-forks.de

advtrains

collided trains are overlapping

Send replies to 112@bugs.linux-forks.de or using the Form below.
avatar From: OP
Wed, 13 Feb 2019 10:12:01 -0000

After a crash are trains still stopping in an overlapped state.

https://li-fo.de/traincrash

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.

avatar From: Someone else
Tue, 17 Sep 2019 20:24:01 -0000

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

advtrains.atc.train_reset_command(train)

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

advtrains.atc.train_reset_command(col_tr)

train.is_shunt = nil

col_tr.is_shunt = nil

minetest.after(0,advtrains.do_connect_trains, col_tr.id, train.id, train.velocity)

end

end

end

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

--

yw05 <yw05@disroot.org>

Reply