Hemiptera Bugtracker at bugs.linux-forks.de

advtrains

More turnouts: Y-shaped and 3-way

Send replies to 162@bugs.linux-forks.de or using the Form below.
avatar From: OP
Sat, 12 Sep 2020 07:25:02 -0000

I have made models for Y-shaped and 3-way turnouts. These are some very

useful shapes!

I added native support for the three-way turnouts by giving them 5 entries

in the conns table, the last entry being unused but useful to distinguish

from crossings without refactoring the rest of the code. It was also

necessary to update the setstate function to not assume two-state switches

but instead set the state that was specifically passed - as used in

interlocking.

See the code at https://github.com/Montandalar/advtrains/pull/5

avatar From: Someone else
Sat, 12 Sep 2020 14:01:01 -0000

Nice work on the turnouts!

I noticed something weird when setting a route from a headshunt when

testing though, see:

https://github.com/Montandalar/advtrains/issues/6

avatar From: OP
Mon, 14 Sep 2020 14:18:01 -0000

I have pushed a new commit to address this issue,

https://github.com/Montandalar/advtrains/commit/61009bf00dc705077ca42d003e4c164d162f83ab

It is the new tip of the moreturnouts branch

avatar From: Someone else
Mon, 14 Sep 2020 22:36:02 -0000

just updated to 1a743c2

crashes when assigning tcb near 3way turnout

from console:

2020-09-15 06:16:26: ERROR[Main]: ServerError: AsyncErr:

ServerThread::run Lua: Runtime error from mod '' in callback

node_on_punch():

/home/corey/.minetest/mods/advtrains/advtrains/helpers.lua:44:

advtrains: in helpers.lua/dir_to_vector() given dir=nil

2020-09-15 06:16:26: ERROR[Main]: stack traceback:

2020-09-15 06:16:26: ERROR[Main]:       [C]: in function 'error'

2020-09-15 06:16:26: ERROR[Main]:

/home/mt/.minetest/mods/advtrains/advtrains/helpers.lua:44: in function

'dirToCoord'

2020-09-15 06:16:26: ERROR[Main]:

/home/mt/.minetest/mods/advtrains/advtrains/helpers.lua:34: in function

'dirCoordSet'

2020-09-15 06:16:26: ERROR[Main]:

/home/mt/.minetest/mods/advtrains/advtrains/helpers.lua:313: in function

'get_adjacent_rail'

2020-09-15 06:16:26: ERROR[Main]:

...etest/mods/advtrains/advtrains_interlocking/database.lua:271: in

function 'traverser'

2020-09-15 06:16:26: ERROR[Main]:

...etest/mods/advtrains/advtrains_interlocking/database.lua:295: in

function 'traverser'

2020-09-15 06:16:26: ERROR[Main]:

...etest/mods/advtrains/advtrains_interlocking/database.lua:295: in

function 'traverser'

2020-09-15 06:16:26: ERROR[Main]:

...etest/mods/advtrains/advtrains_interlocking/database.lua:295: in

function 'traverser'

2020-09-15 06:16:26: ERROR[Main]:

...etest/mods/advtrains/advtrains_interlocking/database.lua:344: in

function 'sync_tcb_neighbors'

2020-09-15 06:16:26: ERROR[Main]:

...test/mods/advtrains/advtrains_interlocking/tcb_ts_ui.lua:125: in

function 'callback'

2020-09-15 06:16:26: ERROR[Main]:

/usr/share/minetest/builtin/game/item.lua:505: in function

</usr/share/minetest/builtin/game/item.lua:498>

see https://github.com/Montandalar/advtrains/issues/7 for more info and

image

avatar From: OP
Tue, 15 Sep 2020 06:26:01 -0000

The above issue resulted from using ["3"] as the key in the conns table for

3-way turnouts. I have pushed another commit to fix. Thank you for doing

the important job of testing this! Makes me think we should have automated

tests too though.

https://github.com/Montandalar/advtrains/pull/8

Reply