src/strings.cpp
changeset 10347 6da2d30f2fe8
parent 10310 ca2eb5811a07
child 10366 74b3472edfa4
equal deleted inserted replaced
10346:9d7959a892fe 10347:6da2d30f2fe8
   860 
   860 
   861 				const Station *st = GetStation(sid);
   861 				const Station *st = GetStation(sid);
   862 				if (st->name != NULL) {
   862 				if (st->name != NULL) {
   863 					buff = strecpy(buff, st->name, last);
   863 					buff = strecpy(buff, st->name, last);
   864 				} else {
   864 				} else {
       
   865 					StringID str = st->string_id;
       
   866 					if (st->indtype != IT_INVALID) {
       
   867 						/* Special case where the industry provides the name for the station */
       
   868 						const IndustrySpec *indsp = GetIndustrySpec(st->indtype);
       
   869 
       
   870 						/* Industry GRFs can change which might remove the station name and
       
   871 						 * thus cause very strange things. Here we check for that before we
       
   872 						 * actually set the station name. */
       
   873 						if (indsp->station_name != STR_NULL && indsp->station_name != STR_UNDEFINED) {
       
   874 							str = indsp->station_name;
       
   875 						}
       
   876 					}
       
   877 
   865 					int64 temp[3];
   878 					int64 temp[3];
   866 					temp[0] = STR_TOWN;
   879 					temp[0] = STR_TOWN;
   867 					temp[1] = st->town->index;
   880 					temp[1] = st->town->index;
   868 					temp[2] = st->index;
   881 					temp[2] = st->index;
   869 					buff = GetStringWithArgs(buff, st->string_id, temp, last);
   882 					buff = GetStringWithArgs(buff, str, temp, last);
   870 				}
   883 				}
   871 				break;
   884 				break;
   872 			}
   885 			}
   873 
   886 
   874 			case SCC_TOWN_NAME: { // {TOWN}
   887 			case SCC_TOWN_NAME: { // {TOWN}