vehicle.c
changeset 3047 acae37f12efb
parent 3040 c3473d1fb81f
child 3105 4a6514d7a8ba
equal deleted inserted replaced
3046:f81bee40701f 3047:acae37f12efb
  2051 	SLE_VAR(Vehicle,subtype,					SLE_UINT8),
  2051 	SLE_VAR(Vehicle,subtype,					SLE_UINT8),
  2052 
  2052 
  2053 	SLE_REF(Vehicle,next,							REF_VEHICLE_OLD),
  2053 	SLE_REF(Vehicle,next,							REF_VEHICLE_OLD),
  2054 	SLE_VAR(Vehicle,string_id,				SLE_STRINGID),
  2054 	SLE_VAR(Vehicle,string_id,				SLE_STRINGID),
  2055 	SLE_CONDVAR(Vehicle,unitnumber,				SLE_FILE_U8 | SLE_VAR_U16, 0, 7),
  2055 	SLE_CONDVAR(Vehicle,unitnumber,				SLE_FILE_U8 | SLE_VAR_U16, 0, 7),
  2056 	SLE_CONDVAR(Vehicle,unitnumber,				SLE_UINT16, 8, 255),
  2056 	SLE_CONDVAR(Vehicle,unitnumber,				SLE_UINT16, 8, SL_MAX_VERSION),
  2057 	SLE_VAR(Vehicle,owner,						SLE_UINT8),
  2057 	SLE_VAR(Vehicle,owner,						SLE_UINT8),
  2058 	SLE_CONDVAR(Vehicle,tile,					SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2058 	SLE_CONDVAR(Vehicle,tile,					SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2059 	SLE_CONDVAR(Vehicle,tile,					SLE_UINT32, 6, 255),
  2059 	SLE_CONDVAR(Vehicle,tile,					SLE_UINT32, 6, SL_MAX_VERSION),
  2060 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2060 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2061 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_UINT32, 6, 255),
  2061 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_UINT32, 6, SL_MAX_VERSION),
  2062 
  2062 
  2063 	SLE_CONDVAR(Vehicle,x_pos,				SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2063 	SLE_CONDVAR(Vehicle,x_pos,				SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2064 	SLE_CONDVAR(Vehicle,x_pos,				SLE_UINT32, 6, 255),
  2064 	SLE_CONDVAR(Vehicle,x_pos,				SLE_UINT32, 6, SL_MAX_VERSION),
  2065 	SLE_CONDVAR(Vehicle,y_pos,				SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2065 	SLE_CONDVAR(Vehicle,y_pos,				SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2066 	SLE_CONDVAR(Vehicle,y_pos,				SLE_UINT32, 6, 255),
  2066 	SLE_CONDVAR(Vehicle,y_pos,				SLE_UINT32, 6, SL_MAX_VERSION),
  2067 	SLE_VAR(Vehicle,z_pos,						SLE_UINT8),
  2067 	SLE_VAR(Vehicle,z_pos,						SLE_UINT8),
  2068 	SLE_VAR(Vehicle,direction,				SLE_UINT8),
  2068 	SLE_VAR(Vehicle,direction,				SLE_UINT8),
  2069 
  2069 
  2070 	SLE_VAR(Vehicle,cur_image,				SLE_UINT16),
  2070 	SLE_VAR(Vehicle,cur_image,				SLE_UINT16),
  2071 	SLE_VAR(Vehicle,spritenum,				SLE_UINT8),
  2071 	SLE_VAR(Vehicle,spritenum,				SLE_UINT8),
  2082 	SLE_VAR(Vehicle,acceleration,			SLE_UINT8),
  2082 	SLE_VAR(Vehicle,acceleration,			SLE_UINT8),
  2083 	SLE_VAR(Vehicle,progress,					SLE_UINT8),
  2083 	SLE_VAR(Vehicle,progress,					SLE_UINT8),
  2084 
  2084 
  2085 	SLE_VAR(Vehicle,vehstatus,				SLE_UINT8),
  2085 	SLE_VAR(Vehicle,vehstatus,				SLE_UINT8),
  2086 	SLE_CONDVAR(Vehicle,last_station_visited, SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2086 	SLE_CONDVAR(Vehicle,last_station_visited, SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2087 	SLE_CONDVAR(Vehicle,last_station_visited, SLE_UINT16, 5, 255),
  2087 	SLE_CONDVAR(Vehicle,last_station_visited, SLE_UINT16, 5, SL_MAX_VERSION),
  2088 
  2088 
  2089 	SLE_VAR(Vehicle,cargo_type,				SLE_UINT8),
  2089 	SLE_VAR(Vehicle,cargo_type,				SLE_UINT8),
  2090 	SLE_VAR(Vehicle,cargo_days,				SLE_UINT8),
  2090 	SLE_VAR(Vehicle,cargo_days,				SLE_UINT8),
  2091 	SLE_CONDVAR(Vehicle,cargo_source,			SLE_FILE_U8 | SLE_VAR_U16, 0, 6),
  2091 	SLE_CONDVAR(Vehicle,cargo_source,			SLE_FILE_U8 | SLE_VAR_U16, 0, 6),
  2092 	SLE_CONDVAR(Vehicle,cargo_source,			SLE_UINT16, 7, 255),
  2092 	SLE_CONDVAR(Vehicle,cargo_source,			SLE_UINT16, 7, SL_MAX_VERSION),
  2093 	SLE_VAR(Vehicle,cargo_cap,				SLE_UINT16),
  2093 	SLE_VAR(Vehicle,cargo_cap,				SLE_UINT16),
  2094 	SLE_VAR(Vehicle,cargo_count,			SLE_UINT16),
  2094 	SLE_VAR(Vehicle,cargo_count,			SLE_UINT16),
  2095 
  2095 
  2096 	SLE_VAR(Vehicle,day_counter,			SLE_UINT8),
  2096 	SLE_VAR(Vehicle,day_counter,			SLE_UINT8),
  2097 	SLE_VAR(Vehicle,tick_counter,			SLE_UINT8),
  2097 	SLE_VAR(Vehicle,tick_counter,			SLE_UINT8),
  2104 	    converted correctly */
  2104 	    converted correctly */
  2105 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, type),    SLE_UINT8,  0, 4),
  2105 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, type),    SLE_UINT8,  0, 4),
  2106 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2106 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2107 
  2107 
  2108 	/* Orders for version 5 and on */
  2108 	/* Orders for version 5 and on */
  2109 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, type),    SLE_UINT8,  5, 255),
  2109 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, type),    SLE_UINT8,  5, SL_MAX_VERSION),
  2110 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, flags),   SLE_UINT8,  5, 255),
  2110 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, flags),   SLE_UINT8,  5, SL_MAX_VERSION),
  2111 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, 255),
  2111 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, SL_MAX_VERSION),
  2112 
  2112 
  2113 	SLE_REF(Vehicle,orders,						REF_ORDER),
  2113 	SLE_REF(Vehicle,orders,						REF_ORDER),
  2114 
  2114 
  2115 	SLE_VAR(Vehicle,age,							SLE_UINT16),
  2115 	SLE_VAR(Vehicle,age,							SLE_UINT16),
  2116 	SLE_VAR(Vehicle,max_age,					SLE_UINT16),
  2116 	SLE_VAR(Vehicle,max_age,					SLE_UINT16),
  2135 
  2135 
  2136 	SLE_REF(Vehicle,next_shared,				REF_VEHICLE),
  2136 	SLE_REF(Vehicle,next_shared,				REF_VEHICLE),
  2137 	SLE_REF(Vehicle,prev_shared,				REF_VEHICLE),
  2137 	SLE_REF(Vehicle,prev_shared,				REF_VEHICLE),
  2138 
  2138 
  2139 	// reserve extra space in savegame here. (currently 10 bytes)
  2139 	// reserve extra space in savegame here. (currently 10 bytes)
  2140 	SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 2, 255),
  2140 	SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 10, 2, SL_MAX_VERSION),
  2141 
  2141 
  2142 	SLE_END()
  2142 	SLE_END()
  2143 };
  2143 };
  2144 
  2144 
  2145 
  2145 
  2149 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,crash_anim_pos), SLE_UINT16),
  2149 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,crash_anim_pos), SLE_UINT16),
  2150 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,force_proceed), SLE_UINT8),
  2150 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,force_proceed), SLE_UINT8),
  2151 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,railtype), SLE_UINT8),
  2151 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,railtype), SLE_UINT8),
  2152 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,track), SLE_UINT8),
  2152 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRail,track), SLE_UINT8),
  2153 
  2153 
  2154 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,flags), SLE_UINT8, 2, 255),
  2154 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,flags), SLE_UINT8, 2, SL_MAX_VERSION),
  2155 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,days_since_order_progr), SLE_UINT16, 2, 255),
  2155 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRail,days_since_order_progr), SLE_UINT16, 2, SL_MAX_VERSION),
  2156 
  2156 
  2157 	SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 2, 2, 19),
  2157 	SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 2, 2, 19),
  2158 	// reserve extra space in savegame here. (currently 11 bytes)
  2158 	// reserve extra space in savegame here. (currently 11 bytes)
  2159 	SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 11, 2, 255),
  2159 	SLE_CONDARR(NullStruct, null, SLE_FILE_U8 | SLE_VAR_NULL, 11, 2, SL_MAX_VERSION),
  2160 
  2160 
  2161 	SLE_END()
  2161 	SLE_END()
  2162 };
  2162 };
  2163 
  2163 
  2164 static const SaveLoad _roadveh_desc[] = {
  2164 static const SaveLoad _roadveh_desc[] = {
  2170 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,overtaking),		SLE_UINT8),
  2170 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,overtaking),		SLE_UINT8),
  2171 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,overtaking_ctr),SLE_UINT8),
  2171 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,overtaking_ctr),SLE_UINT8),
  2172 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,crashed_ctr),		SLE_UINT16),
  2172 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,crashed_ctr),		SLE_UINT16),
  2173 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,reverse_ctr),			SLE_UINT8),
  2173 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,reverse_ctr),			SLE_UINT8),
  2174 
  2174 
  2175 	SLE_CONDREFX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot), REF_ROADSTOPS, 6, 255),
  2175 	SLE_CONDREFX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot), REF_ROADSTOPS, 6, SL_MAX_VERSION),
  2176 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slotindex), SLE_UINT8, 6, 255),
  2176 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slotindex), SLE_UINT8, 6, SL_MAX_VERSION),
  2177 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot_age), SLE_UINT8, 6, 255),
  2177 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleRoad,slot_age), SLE_UINT8, 6, SL_MAX_VERSION),
  2178 	// reserve extra space in savegame here. (currently 16 bytes)
  2178 	// reserve extra space in savegame here. (currently 16 bytes)
  2179 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255),
  2179 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION),
  2180 
  2180 
  2181 	SLE_END()
  2181 	SLE_END()
  2182 };
  2182 };
  2183 
  2183 
  2184 static const SaveLoad _ship_desc[] = {
  2184 static const SaveLoad _ship_desc[] = {
  2185 	SLE_WRITEBYTE(Vehicle,type,VEH_Ship, 2), // Ship type. VEH_Ship in mem, 2 in file.
  2185 	SLE_WRITEBYTE(Vehicle,type,VEH_Ship, 2), // Ship type. VEH_Ship in mem, 2 in file.
  2186 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
  2186 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
  2187 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleShip,state),				SLE_UINT8),
  2187 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleShip,state),				SLE_UINT8),
  2188 
  2188 
  2189 	// reserve extra space in savegame here. (currently 16 bytes)
  2189 	// reserve extra space in savegame here. (currently 16 bytes)
  2190 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255),
  2190 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION),
  2191 
  2191 
  2192 	SLE_END()
  2192 	SLE_END()
  2193 };
  2193 };
  2194 
  2194 
  2195 static const SaveLoad _aircraft_desc[] = {
  2195 static const SaveLoad _aircraft_desc[] = {
  2197 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
  2197 	SLE_INCLUDEX(0, INC_VEHICLE_COMMON),
  2198 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,crashed_counter),	SLE_UINT16),
  2198 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,crashed_counter),	SLE_UINT16),
  2199 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,pos),							SLE_UINT8),
  2199 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,pos),							SLE_UINT8),
  2200 
  2200 
  2201 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,targetairport),		SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2201 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,targetairport),		SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2202 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,targetairport),		SLE_UINT16, 5, 255),
  2202 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,targetairport),		SLE_UINT16, 5, SL_MAX_VERSION),
  2203 
  2203 
  2204 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,state),						SLE_UINT8),
  2204 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleAir,state),						SLE_UINT8),
  2205 
  2205 
  2206 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,previous_pos),			SLE_UINT8, 2, 255),
  2206 	SLE_CONDVARX(offsetof(Vehicle,u)+offsetof(VehicleAir,previous_pos),			SLE_UINT8, 2, SL_MAX_VERSION),
  2207 
  2207 
  2208 	// reserve extra space in savegame here. (currently 15 bytes)
  2208 	// reserve extra space in savegame here. (currently 15 bytes)
  2209 	SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 15, 2, 255),
  2209 	SLE_CONDARR(NullStruct,null,SLE_FILE_U8 | SLE_VAR_NULL, 15, 2, SL_MAX_VERSION),
  2210 
  2210 
  2211 	SLE_END()
  2211 	SLE_END()
  2212 };
  2212 };
  2213 
  2213 
  2214 static const SaveLoad _special_desc[] = {
  2214 static const SaveLoad _special_desc[] = {
  2215 	SLE_WRITEBYTE(Vehicle,type,VEH_Special, 4),
  2215 	SLE_WRITEBYTE(Vehicle,type,VEH_Special, 4),
  2216 
  2216 
  2217 	SLE_VAR(Vehicle,subtype,					SLE_UINT8),
  2217 	SLE_VAR(Vehicle,subtype,					SLE_UINT8),
  2218 
  2218 
  2219 	SLE_CONDVAR(Vehicle,tile,					SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2219 	SLE_CONDVAR(Vehicle,tile,					SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2220 	SLE_CONDVAR(Vehicle,tile,					SLE_UINT32, 6, 255),
  2220 	SLE_CONDVAR(Vehicle,tile,					SLE_UINT32, 6, SL_MAX_VERSION),
  2221 
  2221 
  2222 	SLE_CONDVAR(Vehicle,x_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2222 	SLE_CONDVAR(Vehicle,x_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2223 	SLE_CONDVAR(Vehicle,x_pos,				SLE_INT32, 6, 255),
  2223 	SLE_CONDVAR(Vehicle,x_pos,				SLE_INT32, 6, SL_MAX_VERSION),
  2224 	SLE_CONDVAR(Vehicle,y_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2224 	SLE_CONDVAR(Vehicle,y_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2225 	SLE_CONDVAR(Vehicle,y_pos,				SLE_INT32, 6, 255),
  2225 	SLE_CONDVAR(Vehicle,y_pos,				SLE_INT32, 6, SL_MAX_VERSION),
  2226 	SLE_VAR(Vehicle,z_pos,						SLE_UINT8),
  2226 	SLE_VAR(Vehicle,z_pos,						SLE_UINT8),
  2227 
  2227 
  2228 	SLE_VAR(Vehicle,cur_image,				SLE_UINT16),
  2228 	SLE_VAR(Vehicle,cur_image,				SLE_UINT16),
  2229 	SLE_VAR(Vehicle,sprite_width,			SLE_UINT8),
  2229 	SLE_VAR(Vehicle,sprite_width,			SLE_UINT8),
  2230 	SLE_VAR(Vehicle,sprite_height,		SLE_UINT8),
  2230 	SLE_VAR(Vehicle,sprite_height,		SLE_UINT8),
  2236 
  2236 
  2237 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleSpecial,unk0),	SLE_UINT16),
  2237 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleSpecial,unk0),	SLE_UINT16),
  2238 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleSpecial,unk2),	SLE_UINT8),
  2238 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleSpecial,unk2),	SLE_UINT8),
  2239 
  2239 
  2240 	// reserve extra space in savegame here. (currently 16 bytes)
  2240 	// reserve extra space in savegame here. (currently 16 bytes)
  2241 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255),
  2241 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION),
  2242 
  2242 
  2243 	SLE_END()
  2243 	SLE_END()
  2244 };
  2244 };
  2245 
  2245 
  2246 static const SaveLoad _disaster_desc[] = {
  2246 static const SaveLoad _disaster_desc[] = {
  2248 
  2248 
  2249 	SLE_REF(Vehicle,next,							REF_VEHICLE_OLD),
  2249 	SLE_REF(Vehicle,next,							REF_VEHICLE_OLD),
  2250 
  2250 
  2251 	SLE_VAR(Vehicle,subtype,					SLE_UINT8),
  2251 	SLE_VAR(Vehicle,subtype,					SLE_UINT8),
  2252 	SLE_CONDVAR(Vehicle,tile,					SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2252 	SLE_CONDVAR(Vehicle,tile,					SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2253 	SLE_CONDVAR(Vehicle,tile,					SLE_UINT32, 6, 255),
  2253 	SLE_CONDVAR(Vehicle,tile,					SLE_UINT32, 6, SL_MAX_VERSION),
  2254 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2254 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_FILE_U16 | SLE_VAR_U32, 0, 5),
  2255 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_UINT32, 6, 255),
  2255 	SLE_CONDVAR(Vehicle,dest_tile,		SLE_UINT32, 6, SL_MAX_VERSION),
  2256 
  2256 
  2257 	SLE_CONDVAR(Vehicle,x_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2257 	SLE_CONDVAR(Vehicle,x_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2258 	SLE_CONDVAR(Vehicle,x_pos,				SLE_INT32, 6, 255),
  2258 	SLE_CONDVAR(Vehicle,x_pos,				SLE_INT32, 6, SL_MAX_VERSION),
  2259 	SLE_CONDVAR(Vehicle,y_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2259 	SLE_CONDVAR(Vehicle,y_pos,				SLE_FILE_I16 | SLE_VAR_I32, 0, 5),
  2260 	SLE_CONDVAR(Vehicle,y_pos,				SLE_INT32, 6, 255),
  2260 	SLE_CONDVAR(Vehicle,y_pos,				SLE_INT32, 6, SL_MAX_VERSION),
  2261 	SLE_VAR(Vehicle,z_pos,						SLE_UINT8),
  2261 	SLE_VAR(Vehicle,z_pos,						SLE_UINT8),
  2262 	SLE_VAR(Vehicle,direction,				SLE_UINT8),
  2262 	SLE_VAR(Vehicle,direction,				SLE_UINT8),
  2263 
  2263 
  2264 	SLE_VAR(Vehicle,x_offs,						SLE_INT8),
  2264 	SLE_VAR(Vehicle,x_offs,						SLE_INT8),
  2265 	SLE_VAR(Vehicle,y_offs,						SLE_INT8),
  2265 	SLE_VAR(Vehicle,y_offs,						SLE_INT8),
  2267 	SLE_VAR(Vehicle,sprite_height,		SLE_UINT8),
  2267 	SLE_VAR(Vehicle,sprite_height,		SLE_UINT8),
  2268 	SLE_VAR(Vehicle,z_height,					SLE_UINT8),
  2268 	SLE_VAR(Vehicle,z_height,					SLE_UINT8),
  2269 	SLE_VAR(Vehicle,owner,						SLE_UINT8),
  2269 	SLE_VAR(Vehicle,owner,						SLE_UINT8),
  2270 	SLE_VAR(Vehicle,vehstatus,				SLE_UINT8),
  2270 	SLE_VAR(Vehicle,vehstatus,				SLE_UINT8),
  2271 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2271 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_FILE_U8 | SLE_VAR_U16, 0, 4),
  2272 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, 255),
  2272 	SLE_CONDVARX(offsetof(Vehicle, current_order) + offsetof(Order, station), SLE_UINT16, 5, SL_MAX_VERSION),
  2273 
  2273 
  2274 	SLE_VAR(Vehicle,cur_image,				SLE_UINT16),
  2274 	SLE_VAR(Vehicle,cur_image,				SLE_UINT16),
  2275 	SLE_VAR(Vehicle,age,							SLE_UINT16),
  2275 	SLE_VAR(Vehicle,age,							SLE_UINT16),
  2276 
  2276 
  2277 	SLE_VAR(Vehicle,tick_counter,			SLE_UINT8),
  2277 	SLE_VAR(Vehicle,tick_counter,			SLE_UINT8),
  2278 
  2278 
  2279 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleDisaster,image_override),	SLE_UINT16),
  2279 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleDisaster,image_override),	SLE_UINT16),
  2280 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleDisaster,unk2),						SLE_UINT16),
  2280 	SLE_VARX(offsetof(Vehicle,u)+offsetof(VehicleDisaster,unk2),						SLE_UINT16),
  2281 
  2281 
  2282 	// reserve extra space in savegame here. (currently 16 bytes)
  2282 	// reserve extra space in savegame here. (currently 16 bytes)
  2283 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, 255),
  2283 	SLE_CONDARR(NullStruct,null,SLE_FILE_U64 | SLE_VAR_NULL, 2, 2, SL_MAX_VERSION),
  2284 
  2284 
  2285 	SLE_END()
  2285 	SLE_END()
  2286 };
  2286 };
  2287 
  2287 
  2288 
  2288