(svn r10320) -Fix [FS#278]: one could only build a limited number of stations before one had to rename them.
authorrubidium
Mon, 25 Jun 2007 10:22:48 +0000
changeset 7055 a98b5a273ddb
parent 7054 780add6d508b
child 7056 6daddeaa79df
(svn r10320) -Fix [FS#278]: one could only build a limited number of stations before one had to rename them.
src/lang/english.txt
src/station_cmd.cpp
src/strings.cpp
--- a/src/lang/english.txt	Mon Jun 25 10:10:37 2007 +0000
+++ b/src/lang/english.txt	Mon Jun 25 10:22:48 2007 +0000
@@ -2082,6 +2082,7 @@
 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!
 
--- a/src/station_cmd.cpp	Mon Jun 25 10:10:37 2007 +0000
+++ b/src/station_cmd.cpp	Mon Jun 25 10:22:48 2007 +0000
@@ -285,11 +285,7 @@
 	}
 
 	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;
--- a/src/strings.cpp	Mon Jun 25 10:10:37 2007 +0000
+++ b/src/strings.cpp	Mon Jun 25 10:22:48 2007 +0000
@@ -817,9 +817,10 @@
 				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;