From 5c6106cbcf78cb422eec7e989b8276b7939259d5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 25 Jun 2007 10:22:48 +0000 Subject: (svn r10320) -Fix [FS#278]: one could only build a limited number of stations before one had to rename them. --- src/lang/english.txt | 1 + src/station_cmd.cpp | 6 +----- src/strings.cpp | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lang/english.txt b/src/lang/english.txt index a27fe393e..2fc29b9c6 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2082,6 +2082,7 @@ STR_SV_STNAME_UPPER :Upper {STRING1} STR_SV_STNAME_LOWER :Lower {STRING1} STR_SV_STNAME_HELIPORT :{STRING1} Heliport STR_SV_STNAME_FOREST :{STRING1} Forest +STR_SV_STNAME_FALLBACK :{STRING1} Station #{NUM} ############ end of savegame specific region! diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 933c89eae..c26e218d1 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -285,11 +285,7 @@ static bool GenerateStationName(Station *st, TileIndex tile, int flag) } tmp = free_names & ((1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 6) | (1 << 7) | (1 << 12) | (1 << 26) | (1 << 27) | (1 << 28) | (1 << 29) | (1 << 30)); - if (tmp == 0) { - _error_message = STR_3007_TOO_MANY_STATIONS_LOADING; - return false; - } - found = FindFirstBit(tmp); + found = (tmp == 0) ? M(STR_SV_STNAME_FALLBACK) : FindFirstBit(tmp); done: st->string_id = found + STR_SV_STNAME; diff --git a/src/strings.cpp b/src/strings.cpp index 85ed61b5c..911786707 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -817,9 +817,10 @@ static char* FormatString(char* buff, const char* str, const int64* argv, uint c if (!st->IsValid()) { // station doesn't exist anymore buff = GetStringWithArgs(buff, STR_UNKNOWN_DESTINATION, NULL, last); } else { - int64 temp[2]; + int64 temp[3]; temp[0] = STR_TOWN; temp[1] = st->town->index; + temp[2] = st->index; buff = GetStringWithArgs(buff, st->string_id, temp, last); } break; -- cgit v1.2.3-54-g00ecf