News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Game crash when trying to build tram track on Narrow Gauge road crossing

Started by 1993matias, June 18, 2022, 02:51:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

1993matias

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.


RESTRICTED ACCOUNT

                    // 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. (´・ω・`)

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

1993matias

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 :) )