The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Nazalassa on August 21, 2025, 07:53:21 AM

Title: r11737 - in some paksets, tunnels cannot be built two tiles above sloped tunnels
Post by: Nazalassa on August 21, 2025, 07:53:21 AM
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.)
Title: Re: r11737 - in some paksets, tunnels cannot be built two tiles above sloped tunnels
Post by: ceeac on August 26, 2025, 10:06:33 AM
Could you add a test for this (probably in test_way_tunnel.nut)?
Title: Re: r11737 - in some paksets, tunnels cannot be built two tiles above sloped tunnels
Post by: Nazalassa on August 27, 2025, 06:46:42 AM
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).
Title: Re: r11737 - in some paksets, tunnels cannot be built two tiles above sloped tunnels
Post by: prissi on August 27, 2025, 01:19:49 PM
THe tests only run if the main language is English.
Title: Re: r11737 - in some paksets, tunnels cannot be built two tiles above sloped tunnels
Post by: ceeac on August 29, 2025, 08:58:08 AM
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.