News:

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

[bug 9.2] when creating new line, number duplicates

Started by ӔO, January 11, 2011, 12:07:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ӔO

I tried this in the latest standard nightly and wasn't able to replicate it.

When starting up a new line, after some lines have been deleted, it seems the game will create a line with the same name.

I've gotten 15 and 16 in my 2 newest lines, and now when starting up a new line in this save game, it should give 17, even though 17 already exists. Not a big deal, but could be confusing with more lines that are not renamed.

using pak britain-ex.
http://dl.dropbox.com/u/17111233/acetate.sve
My Sketchup open project sources
various projects rolled up: http://dl.dropbox.com/u/17111233/Roll_up.rar

Colour safe chart:

TurfIt

I've ran into this with a recent standard nightly (< 1 month) albeit in network mode where I've encountered all sorts of strange happenings with line management.

jamespetts

I suspect that this can be reproduced in Standard under the right conditions, but am having some trouble running Standard at present, so can't test it. I notice that the newly created lines increment correctly, but start from one lower than it appears that they should. I also notice that the line numbers are based on Simutrans's own internal handling of the numbers (in other words, the ID in the quickstone class that provides handles to line objects). I further notice that you have at some point deleted line 5. What I suspect, therefore, is that when you load a game in which line 5 is deleted, the internal mechanism will assign ID numbers to your lines in the order in which it creates them and assign the number 5 to convoy 6, and so forth. Because the lines only refer back to their original ID numberings when first named, and thereafter the names are stored independently, as one can give the lines arbitrary names, so the names and the numbers become misaligned, such that, when one then creates a new line with its automatic name, it will take the next available ID number, which happens to be 17.

To try to reproduce this in Standard, you can follow these steps:

(1) start a new game;
(2) add 3 lines;
(3) delete line no. 2;
(4) save the game;
(5) quit and restart;
(6) load the game;
(7) create a new line.

I suspect that that new line will be called "Line (3)". The only way of fixing this would be to detach the initial naming of lines with their internal IDs, which may require saving with the saved game the last used line number in order to increment consistently.
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.

sdog


Dwachs

#4
Quote from: jamespetts on January 11, 2011, 12:48:58 AM
To try to reproduce this in Standard, you can follow these steps:

(1) start a new game;
(2) add 3 lines;
(3) delete line no. 2;
(4) save the game;
(5) quit and restart;
(6) load the game;
(7) create a new line.

I suspect that that new line will be called "Line (3)".
Confirmed :O Hard to fix ...
Parsley, sage, rosemary, and maggikraut.

Dwachs

Parsley, sage, rosemary, and maggikraut.