src/openttd.cpp
branchcpp_gui
changeset 6268 4b5241e5dd10
parent 6258 a2f86b8fd99b
child 6285 187e3ef04cc9
equal deleted inserted replaced
6267:7c8ec33959b1 6268:4b5241e5dd10
  1286 		DoStartupNewPlayer(false);
  1286 		DoStartupNewPlayer(false);
  1287 
  1287 
  1288 	DoZoomInOutWindow(ZOOM_NONE, w); // update button status
  1288 	DoZoomInOutWindow(ZOOM_NONE, w); // update button status
  1289 	MarkWholeScreenDirty();
  1289 	MarkWholeScreenDirty();
  1290 
  1290 
  1291 	/* From this version on there can be multiple road stops of the same type per
       
  1292 	 * station. Convert the existing stops to the new internal data structure.
       
  1293 	 */
       
  1294 	for (TileIndex t = 0; t < map_size; t++) {
  1291 	for (TileIndex t = 0; t < map_size; t++) {
  1295 		switch (GetTileType(t)) {
  1292 		switch (GetTileType(t)) {
  1296 			case MP_STATION:
  1293 			case MP_STATION: {
       
  1294 				Station *st = GetStationByTile(t);
       
  1295 
       
  1296 				st->rect.BeforeAddTile(t, StationRect::ADD_FORCE);
       
  1297 
  1297 				switch (GetStationType(t)) {
  1298 				switch (GetStationType(t)) {
  1298 					case STATION_TRUCK:
  1299 					case STATION_TRUCK:
  1299 					case STATION_BUS:
  1300 					case STATION_BUS:
  1300 						if (CheckSavegameVersion(6)) {
  1301 						if (CheckSavegameVersion(6)) {
       
  1302 							/* From this version on there can be multiple road stops of the
       
  1303 							 * same type per station. Convert the existing stops to the new
       
  1304 							 * internal data structure. */
  1301 							RoadStop *rs = new RoadStop(t);
  1305 							RoadStop *rs = new RoadStop(t);
  1302 							if (rs == NULL) error("Too many road stops in savegame");
  1306 							if (rs == NULL) error("Too many road stops in savegame");
  1303 
  1307 
  1304 							Station *st = GetStationByTile(t);
       
  1305 							RoadStop **head =
  1308 							RoadStop **head =
  1306 								IsTruckStop(t) ? &st->truck_stops : &st->bus_stops;
  1309 								IsTruckStop(t) ? &st->truck_stops : &st->bus_stops;
  1307 							*head = rs;
  1310 							*head = rs;
  1308 						}
  1311 						}
  1309 						break;
  1312 						break;
  1328 					}
  1331 					}
  1329 
  1332 
  1330 					default: break;
  1333 					default: break;
  1331 				}
  1334 				}
  1332 				break;
  1335 				break;
       
  1336 			}
  1333 
  1337 
  1334 			default: break;
  1338 			default: break;
  1335 		}
  1339 		}
  1336 	}
  1340 	}
  1337 
  1341