File diff r9007:ca4318e2ac57 → r9008:e9055c9e2c9e
src/oldloader.cpp
Show inline comments
 
@@ -1083,15 +1083,15 @@ static const OldChunks vehicle_air_chunk
 

	
 
	OCL_NULL( 5 ), ///< Junk
 

	
 
	OCL_END()
 
};
 

	
 
static const OldChunks vehicle_special_chunk[] = {
 
	OCL_SVAR( OC_UINT16, VehicleSpecial, animation_state ),
 
	OCL_SVAR(  OC_UINT8, VehicleSpecial, animation_substate ),
 
static const OldChunks vehicle_effect_chunk[] = {
 
	OCL_SVAR( OC_UINT16, VehicleEffect, animation_state ),
 
	OCL_SVAR(  OC_UINT8, VehicleEffect, animation_substate ),
 

	
 
	OCL_NULL( 7 ), // Junk
 

	
 
	OCL_END()
 
};
 

	
 
@@ -1120,13 +1120,13 @@ static bool LoadOldVehicleUnion(Loadgame
 
		default: NOT_REACHED();
 
		case VEH_INVALID : res = LoadChunk(ls, NULL,           vehicle_empty_chunk);    break;
 
		case VEH_TRAIN   : res = LoadChunk(ls, &v->u.rail,     vehicle_train_chunk);    break;
 
		case VEH_ROAD    : res = LoadChunk(ls, &v->u.road,     vehicle_road_chunk);     break;
 
		case VEH_SHIP    : res = LoadChunk(ls, &v->u.ship,     vehicle_ship_chunk);     break;
 
		case VEH_AIRCRAFT: res = LoadChunk(ls, &v->u.air,      vehicle_air_chunk);      break;
 
		case VEH_SPECIAL : res = LoadChunk(ls, &v->u.special,  vehicle_special_chunk);  break;
 
		case VEH_EFFECT  : res = LoadChunk(ls, &v->u.effect,   vehicle_effect_chunk);   break;
 
		case VEH_DISASTER: res = LoadChunk(ls, &v->u.disaster, vehicle_disaster_chunk); break;
 
	}
 

	
 
	/* This chunk size should always be 10 bytes */
 
	if (ls->total_read - temp != 10) {
 
		DEBUG(oldloader, 0, "Assert failed in VehicleUnion: invalid chunk size");
 
@@ -1233,13 +1233,13 @@ bool LoadOldVehicle(LoadgameState *ls, i
 
			default: NOT_REACHED();
 
			case 0x00 /*VEH_INVALID */: v = new (_current_vehicle_id) InvalidVehicle();  break;
 
			case 0x10 /*VEH_TRAIN   */: v = new (_current_vehicle_id) Train();           break;
 
			case 0x11 /*VEH_ROAD    */: v = new (_current_vehicle_id) RoadVehicle();     break;
 
			case 0x12 /*VEH_SHIP    */: v = new (_current_vehicle_id) Ship();            break;
 
			case 0x13 /*VEH_AIRCRAFT*/: v = new (_current_vehicle_id) Aircraft();        break;
 
			case 0x14 /*VEH_SPECIAL */: v = new (_current_vehicle_id) SpecialVehicle();  break;
 
			case 0x14 /*VEH_EFFECT  */: v = new (_current_vehicle_id) EffectVehicle();   break;
 
			case 0x15 /*VEH_DISASTER*/: v = new (_current_vehicle_id) DisasterVehicle(); break;
 
		}
 
		if (!LoadChunk(ls, v, vehicle_chunk)) return false;
 

	
 
		/* This should be consistent, else we have a big problem... */
 
		if (v->index != _current_vehicle_id) {
 
@@ -1267,13 +1267,13 @@ bool LoadOldVehicle(LoadgameState *ls, i
 
		if (_old_next_ptr != 0xFFFF) v->next = GetVehiclePoolSize() <= _old_next_ptr ? new (_old_next_ptr) InvalidVehicle() : GetVehicle(_old_next_ptr);
 

	
 
		_old_string_id = RemapOldStringID(_old_string_id);
 
		v->name = CopyFromOldName(_old_string_id);
 

	
 
		/* Vehicle-subtype is different in TTD(Patch) */
 
		if (v->type == VEH_SPECIAL) v->subtype = v->subtype >> 1;
 
		if (v->type == VEH_EFFECT) v->subtype = v->subtype >> 1;
 

	
 
		if (_cargo_count != 0) {
 
			CargoPacket *cp = new CargoPacket((_cargo_source == 0xFF) ? INVALID_STATION : _cargo_source, _cargo_count);
 
			cp->days_in_transit = _cargo_days;
 
			v->cargo.Append(cp);
 
		}