Changeset - r21188:feedde90762e
[Not reviewed]
master
0 1 0
frosch - 11 years ago 2014-01-23 20:23:14
frosch@openttd.org
(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.
1 file changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -244,12 +244,20 @@ static StringID GenerateStationName(Stat
 

	
 
	const Station *s;
 
	FOR_ALL_STATIONS(s) {
 
		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);
 
			if (str <= 0x20) {
 
				if (str == M(STR_SV_STNAME_FOREST)) {
 
					str = M(STR_SV_STNAME_WOODS);
0 comments (0 inline, 0 general)