File diff r13287:52547c48c3ba → r13288:93fbc02f05b0
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -710,28 +710,25 @@ void Load_VEHS()
 
			case VEH_SHIP:     v = new (index) Ship();            break;
 
			case VEH_AIRCRAFT: v = new (index) Aircraft();        break;
 
			case VEH_EFFECT:   v = new (index) EffectVehicle();   break;
 
			case VEH_DISASTER: v = new (index) DisasterVehicle(); break;
 
			case VEH_INVALID: /* Savegame shouldn't contain invalid vehicles */
 
			default: NOT_REACHED();
 
		}
 

	
 
		SlObject(v, GetVehicleDescription(vtype));
 

	
 
		if (_cargo_count != 0 && IsCompanyBuildableVehicleType(v)) {
 
			/* Don't construct the packet with station here, because that'll fail with old savegames */
 
			CargoPacket *cp = new CargoPacket(_cargo_count, _cargo_days, _cargo_feeder_share);
 
			cp->source          = _cargo_source;
 
			cp->source_xy       = _cargo_source_xy;
 
			cp->loaded_at_xy    = _cargo_loaded_at_xy;
 
			CargoPacket *cp = new CargoPacket(_cargo_count, _cargo_days, _cargo_source, _cargo_source_xy, _cargo_loaded_at_xy, _cargo_feeder_share);
 
			v->cargo.Append(cp);
 
		}
 

	
 
		/* Old savegames used 'last_station_visited = 0xFF' */
 
		if (CheckSavegameVersion(5) && v->last_station_visited == 0xFF)
 
			v->last_station_visited = INVALID_STATION;
 

	
 
		if (CheckSavegameVersion(5)) {
 
			/* Convert the current_order.type (which is a mix of type and flags, because
 
			 *  in those versions, they both were 4 bits big) to type and flags */
 
			v->current_order.flags = GB(v->current_order.type, 4, 4);
 
			v->current_order.type &= 0x0F;