FS#5909 - Fallback station numbers glitches

Attached to Project: OpenTTD
Opened by Simon Smith (Simons_Mith) - Saturday, 15 February 2014, 04:01 GMT
Last edited by Remko Bijker (Rubidium) - Saturday, 15 February 2014, 18:33 GMT
Type Bug
Category Core
Status Closed
Assigned To No-one
Operating System Mac OS X
Severity Low
Priority Normal
Reported Version 1.4.0-beta4
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


In my scratch game, the station numbers in one town, once I'd hit the naming limit, started at #452. But, scratch game, much strangeness, inclusing mucking about the station name strings. Hence don't worry too much at present. However:

In a clean game, I picked a new town, spammed it with truck stops, used up all the names including 2-3 extras provided by FIRS, and ended up with a total of /27/ stations, of which the last few were numbered 19,20,22,23,25,26,27,28. So 21 and 24 missing, and the total station count off by /two/ (two because there were two towns close together and I accidentally placed one station in the neighboring town catchment area.

I suspect fix 26275 may not quite be doing its job; it deduplicates OK, but the interaction with FIRS station names has caused its numbering count to end up needlessly skipping some values.

To reproduce: try any NewGrf that provides additional station names, spam 1-square bus/lorry stations in a town until you start getting stations with #numbered fallback names. Join a couple of 1-square stations into 2-squares (or more) at junctions, I think that may be confusing it too.
This task depends upon

Closed by  Remko Bijker (Rubidium)
Saturday, 15 February 2014, 18:33 GMT
Reason for closing:  Not a bug
Comment by Remko Bijker (Rubidium) - Saturday, 15 February 2014, 18:33 GMT
The numbering in the stations is simply the unique ID of the station. Once a station is removed that ID is freed and can be reused. This numbering has nothing to do with NewGRFs, though... depending on the circumstances a particular station name can be used in one location when it can't be in another. For example East/West/North/South, Valley/Heights, Woods, Mines, Lakeside, Central all have specific preconditions on where they can be built. Due to that it's easily possible that the 22nd station (the one with ID 21) would have gotten a particular name. Furthermore, that 22nd station can also be the one in the "wrong" town.