diff options
author | frosch <frosch@openttd.org> | 2014-01-23 20:23:14 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2014-01-23 20:23:14 +0000 |
commit | 932dad7c8b24e5a1010126e1746034db3e9942e5 (patch) | |
tree | 5a60f40a1dd6e2c56b62e650ad1556766bebc543 /src | |
parent | 278b380d107044c5ba3486f4ad67e7ef89e17938 (diff) | |
download | openttd-932dad7c8b24e5a1010126e1746034db3e9942e5.tar.xz |
(svn r26275) -Fix: If NewGRF provided the same station name for different industry types, stations would end up with same name. So also consider the provided name, not only the industry type.
Diffstat (limited to 'src')
-rw-r--r-- | src/station_cmd.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 6ef602b83..c253679d9 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -247,6 +247,14 @@ static StringID GenerateStationName(Station *st, TileIndex tile, StationNaming n if (s != st && s->town == t) { if (s->indtype != IT_INVALID) { indtypes[s->indtype] = true; + StringID name = GetIndustrySpec(s->indtype)->station_name; + if (name != STR_UNDEFINED) { + /* Filter for other industrytypes with the same name */ + for (IndustryType it = 0; it < NUM_INDUSTRYTYPES; it++) { + const IndustrySpec *indsp = GetIndustrySpec(it); + if (indsp->enabled && indsp->station_name == name) indtypes[it] = true; + } + } continue; } uint str = M(s->string_id); |