From 932dad7c8b24e5a1010126e1746034db3e9942e5 Mon Sep 17 00:00:00 2001 From: frosch Date: Thu, 23 Jan 2014 20:23:14 +0000 Subject: (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. --- src/station_cmd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- cgit v1.2.3-54-g00ecf