News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Reproducible crash from the Change Prices window

Started by Matthew, June 19, 2018, 04:49:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Matthew

Steps to reproduce:
1. Start a new map in the railway era (e.g. 1850)
2. Build some railway track and a depot
3. Open the depot, add a loco
4. Add a carriage of a certain class (e.g. Low) and change it to a different class (e.g. Very low)
5. Now add another carriage of that certain class (in the example, Low), and don't change it
6. Open the 'Change prices' window and it will display 'Reassigned to multiple classes'
7. Click the right arrow to change the class to 'Very high'
8. Click the left arrow to go back again and the game will crash with this message:
"FATAL ERROR: vector.tpl<T>::[] - t: index out of bounds: 5 not 0..4
Aborting program execution..."

The same crash happens when steps 6 to 8 are followed while the train is outside the depot.
(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

jamespetts

Thank you for the report - I think that I have now fixed this - I should be grateful if you could re-test with the next 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.

ACarlotti

James: Your fix only catches the problem at a very low level; those numbers should never be getting there in the first place.

The underlying issue is that 'reassigned to multiple' gets treated as a sixth class in the vehicle class manager. I have pushed a fix to this (and a related off-by-one error that prevented this being caught elsewhere). The primary change is that 'reassigned to multiple' is ignored if selected, and removed from the list when something else is selected.

I have since noticed that a different fix for this underlying issue is already present for the line class manager. As far as I can tell this latter fix will not work in general for a network game, where the dialogue will probably be redrawn before the vehicle class reassignment is actually changed.

In any case, I think these two dialogues should eventually be merged (i.e. refactored to use the same code), but this should probably wait until the new gui currently being developed for Standard is included in Extended.

jamespetts

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.