The International Simutrans Forum

Simutrans Extended => Pak128.Britain-Ex Bug Reports => Pak128.Britain-Ex => Simutrans-Extended paksets => Pak128.Britain-Ex closed bug reports => Topic started by: 1993matias on June 18, 2022, 02:51:11 PM

Title: Game crash when trying to build tram track on Narrow Gauge road crossing
Post by: 1993matias on June 18, 2022, 02:51:11 PM
Hello,

When trying to put tram track on top of a narrow gauge road crossing, the game crashes. Could it be possible to make it at least not crash the game?
Tested on latest nightly.

(https://i.imgur.com/dsiI4mL.png)
Title: Re: Game crash when trying to build tram track on Narrow Gauge road crossing
Post by: Ranran(retired) on June 20, 2022, 12:35:22 AM
                    // If this is a narrow gague way and it attempts to cross a road with a tram track already installed, calling the below method
                    // will crash the game because three different waytypes are not allowed on the same tile. Thus, we must test for this.
                    if (sch->get_waytype() == narrowgauge_wt && gr->has_two_ways())
                    {
                        delete sch;
                        return;
                    }
                    cost = gr->neuen_weg_bauen(sch, ribi, player_builder, &route) - desc->get_value();
I haven't looked into this in detail, but this part of the code doesn't seem to work as intended.

EDIT:
It may not be assumed that the sequence of laying out is done in reverse. (´・ω・`)
Title: Re: Game crash when trying to build tram track on Narrow Gauge road crossing
Post by: jamespetts on June 26, 2022, 11:21:18 AM
Thank you for the report; I believe that this is now fixed. I should be grateful if you could re-test with to-morrow's nightly build.
Title: Re: Game crash when trying to build tram track on Narrow Gauge road crossing
Post by: 1993matias on June 30, 2022, 03:31:00 PM
Yes, works as intended. No track is built and no crash happens. Perfect, thanks you!

(although a warning saying why it happened might help new players :) )