src/station_cmd.cpp
changeset 5879 b3413b837d21
parent 5878 b81cea0c5456
child 5887 65b5fc3f9b02
equal deleted inserted replaced
5878:b81cea0c5456 5879:b3413b837d21
  2839 };
  2839 };
  2840 
  2840 
  2841 static const SaveLoad _station_desc[] = {
  2841 static const SaveLoad _station_desc[] = {
  2842 	SLE_CONDVAR(Station, xy,                         SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2842 	SLE_CONDVAR(Station, xy,                         SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2843 	SLE_CONDVAR(Station, xy,                         SLE_UINT32,                  6, SL_MAX_VERSION),
  2843 	SLE_CONDVAR(Station, xy,                         SLE_UINT32,                  6, SL_MAX_VERSION),
  2844 	SLE_CONDVAR(Station, bus_tile_obsolete,          SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2844 	SLE_CONDNULL(4, 0, 5), // bus/lorry tile
  2845 	SLE_CONDVAR(Station, lorry_tile_obsolete,        SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
       
  2846 	SLE_CONDVAR(Station, train_tile,                 SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2845 	SLE_CONDVAR(Station, train_tile,                 SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2847 	SLE_CONDVAR(Station, train_tile,                 SLE_UINT32,                  6, SL_MAX_VERSION),
  2846 	SLE_CONDVAR(Station, train_tile,                 SLE_UINT32,                  6, SL_MAX_VERSION),
  2848 	SLE_CONDVAR(Station, airport_tile,               SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2847 	SLE_CONDVAR(Station, airport_tile,               SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2849 	SLE_CONDVAR(Station, airport_tile,               SLE_UINT32,                  6, SL_MAX_VERSION),
  2848 	SLE_CONDVAR(Station, airport_tile,               SLE_UINT32,                  6, SL_MAX_VERSION),
  2850 	SLE_CONDVAR(Station, dock_tile,                  SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2849 	SLE_CONDVAR(Station, dock_tile,                  SLE_FILE_U16 | SLE_VAR_U32,  0, 5),
  2970 
  2969 
  2971 			if (GetRailStationAxis(st->train_tile) == AXIS_Y) uintswap(w, h);
  2970 			if (GetRailStationAxis(st->train_tile) == AXIS_Y) uintswap(w, h);
  2972 			st->trainst_w = w;
  2971 			st->trainst_w = w;
  2973 			st->trainst_h = h;
  2972 			st->trainst_h = h;
  2974 		}
  2973 		}
  2975 
       
  2976 		/* In older versions, we had just 1 tile for a bus/lorry, now we have more..
       
  2977 		 *  convert, if needed */
       
  2978 		if (CheckSavegameVersion(6)) {
       
  2979 			if (st->bus_tile_obsolete != 0) {
       
  2980 				st->bus_stops = new RoadStop(st->bus_tile_obsolete);
       
  2981 				if (st->bus_stops == NULL)
       
  2982 					error("Station: too many busstations in savegame");
       
  2983 
       
  2984 			}
       
  2985 			if (st->lorry_tile_obsolete != 0) {
       
  2986 				st->truck_stops = new RoadStop(st->lorry_tile_obsolete);
       
  2987 				if (st->truck_stops == NULL)
       
  2988 					error("Station: too many truckstations in savegame");
       
  2989 
       
  2990 			}
       
  2991 		}
       
  2992 	}
  2974 	}
  2993 
  2975 
  2994 	/* This is to ensure all pointers are within the limits of _stations_size */
  2976 	/* This is to ensure all pointers are within the limits of _stations_size */
  2995 	if (_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
  2977 	if (_station_tick_ctr > GetMaxStationIndex()) _station_tick_ctr = 0;
  2996 }
  2978 }