summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-01-31 09:49:02 +0000
committertron <tron@openttd.org>2007-01-31 09:49:02 +0000
commitd1b861a3dca1a9f5ce26a6caa3b016a6d3b80841 (patch)
tree1114aa14a8b57700137be469a8b76c0940421b4d /src
parentfe1691acce220f6d55a7bcad077020cfbec4bfb5 (diff)
downloadopenttd-d1b861a3dca1a9f5ce26a6caa3b016a6d3b80841.tar.xz
(svn r8478) -Fix
Change the structure of the the loop in r8477 to prepare for further changes
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index cba18f730..a8fea2804 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1285,16 +1285,28 @@ bool AfterLoadGame(void)
/* From this version on there can be multiple road stops of the same type per
* station. Convert the existing stops to the new internal data structure.
*/
- if (CheckSavegameVersion(6)) {
- for (TileIndex t = 0; t < map_size; t++) {
- if (IsRoadStopTile(t)) {
- RoadStop *rs = new RoadStop(t);
- if (rs == NULL) error("Too many road stops in savegame");
+ for (TileIndex t = 0; t < map_size; t++) {
+ switch (GetTileType(t)) {
+ case MP_STATION:
+ switch (GetStationType(t)) {
+ case STATION_TRUCK:
+ case STATION_BUS:
+ if (CheckSavegameVersion(6)) {
+ RoadStop *rs = new RoadStop(t);
+ if (rs == NULL) error("Too many road stops in savegame");
+
+ Station *st = GetStationByTile(t);
+ RoadStop **head =
+ IsTruckStop(t) ? &st->truck_stops : &st->bus_stops;
+ *head = rs;
+ }
+ break;
- Station *st = GetStationByTile(t);
- RoadStop **head = IsTruckStop(t) ? &st->truck_stops : &st->bus_stops;
- *head = rs;
- }
+ default: break;
+ }
+ break;
+
+ default: break;
}
}