File diff r12029:5b077ec055c0 → r12030:bf346482c342
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -100,17 +100,12 @@ void ConnectMultiheadedTrains()
 
 */
 
void ConvertOldMultiheadToNew()
 
{
 
	Vehicle *v;
 
	FOR_ALL_VEHICLES(v) {
 
		if (v->type == VEH_TRAIN) {
 
			SetBit(v->subtype, 7); // indicates that it's the old format and needs to be converted in the next loop
 
		}
 
	}
 
	Train *t;
 
	FOR_ALL_TRAINS(t) SetBit(t->subtype, 7); // indicates that it's the old format and needs to be converted in the next loop
 

	
 
	FOR_ALL_VEHICLES(v) {
 
		if (v->type == VEH_TRAIN) {
 
			if (HasBit(v->subtype, 7) && ((v->subtype & ~0x80) == 0 || (v->subtype & ~0x80) == 4)) {
 
				for (Vehicle *u = v; u != NULL; u = u->Next()) {
 
	FOR_ALL_TRAINS(t) {
 
		if (HasBit(t->subtype, 7) && ((t->subtype & ~0x80) == 0 || (t->subtype & ~0x80) == 4)) {
 
			for (Vehicle *u = t; u != NULL; u = u->Next()) {
 
					const RailVehicleInfo *rvi = RailVehInfo(u->engine_type);
 

	
 
					ClrBit(u->subtype, 7);
 
@@ -153,7 +148,6 @@ void ConvertOldMultiheadToNew()
 
			}
 
		}
 
	}
 
}
 

	
 

	
 
/** need to be called to load aircraft from old version */