src/openttd.cpp
changeset 5880 702273c0850c
parent 5879 b3413b837d21
child 5884 0c9a9c61ca76
equal deleted inserted replaced
5879:b3413b837d21 5880:702273c0850c
  1283 	if (CheckSavegameVersionOldStyle(5, 1)) UpdateOilRig();
  1283 	if (CheckSavegameVersionOldStyle(5, 1)) UpdateOilRig();
  1284 
  1284 
  1285 	/* From this version on there can be multiple road stops of the same type per
  1285 	/* From this version on there can be multiple road stops of the same type per
  1286 	 * station. Convert the existing stops to the new internal data structure.
  1286 	 * station. Convert the existing stops to the new internal data structure.
  1287 	 */
  1287 	 */
  1288 	if (CheckSavegameVersion(6)) {
  1288 	for (TileIndex t = 0; t < map_size; t++) {
  1289 		for (TileIndex t = 0; t < map_size; t++) {
  1289 		switch (GetTileType(t)) {
  1290 			if (IsRoadStopTile(t)) {
  1290 			case MP_STATION:
  1291 				RoadStop *rs = new RoadStop(t);
  1291 				switch (GetStationType(t)) {
  1292 				if (rs == NULL) error("Too many road stops in savegame");
  1292 					case STATION_TRUCK:
  1293 
  1293 					case STATION_BUS:
  1294 				Station *st = GetStationByTile(t);
  1294 						if (CheckSavegameVersion(6)) {
  1295 				RoadStop **head = IsTruckStop(t) ? &st->truck_stops : &st->bus_stops;
  1295 							RoadStop *rs = new RoadStop(t);
  1296 				*head = rs;
  1296 							if (rs == NULL) error("Too many road stops in savegame");
  1297 			}
  1297 
       
  1298 							Station *st = GetStationByTile(t);
       
  1299 							RoadStop **head =
       
  1300 								IsTruckStop(t) ? &st->truck_stops : &st->bus_stops;
       
  1301 							*head = rs;
       
  1302 						}
       
  1303 						break;
       
  1304 
       
  1305 					default: break;
       
  1306 				}
       
  1307 				break;
       
  1308 
       
  1309 			default: break;
  1298 		}
  1310 		}
  1299 	}
  1311 	}
  1300 
  1312 
  1301 	/* In version 6.1 we put the town index in the map-array. To do this, we need
  1313 	/* In version 6.1 we put the town index in the map-array. To do this, we need
  1302 	 *  to use m2 (16bit big), so we need to clean m2, and that is where this is
  1314 	 *  to use m2 (16bit big), so we need to clean m2, and that is where this is