News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

r11737 - in some paksets, tunnels cannot be built two tiles above sloped tunnels

Started by Nazalassa, August 21, 2025, 07:53:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nazalassa

When in a pakset with way_height_clearance=1 (i.e ways are 1 tile high), it is not possible to build tunnels on empty space 2 tiles above a sloped tunnel. This patch fixes this. Tested for both one- and two-tile deep slopes in tunnels (road/train in pak64).

Diagram: in a pakset where ways are 1 tile high, tunnels can not be built on tile A because it is an empty space 2 tiles above tile B, which is a slope. The patch makes the waybuilder recognise and ignore this specific situation. (If the slope in B were two tiles high, normal behaviour applies.)

___  ___  ___   A    .    .

___  ___  ___   .    .    .
               \
 .    .    .    B\  ___  ___


(The waybuilder looks for tiles below the tunnel because there might be a sloped tunnel there, to which the new tunnel would have to connect. But in this case, there is no reason to connect to the slope it found since it does not reach high enough, so the waybuilder should ignore it and keep going straight.)

ceeac

Could you add a test for this (probably in test_way_tunnel.nut)?

Nazalassa

If I did everything correctly, this patch should add the test. I tried to run all tests with pak64 but some tests failed (e.g monorail depot).

prissi


ceeac

Incorporated in r11743, thanks. However, I have removed the check that checks that building a tunnel across the top half of a double sloped tunnel fails; this check failed which seems to be a different but related bug.