src/openttd.cpp
changeset 10121 b82006b98b4a
parent 10117 6a796f06bff4
child 10158 e4e8e74d96c7
--- a/src/openttd.cpp	Thu Apr 10 11:59:18 2008 +0000
+++ b/src/openttd.cpp	Thu Apr 10 17:23:51 2008 +0000
@@ -2452,6 +2452,23 @@
 
 		Vehicle *v;
 		FOR_ALL_VEHICLES(v) v->current_order.ConvertFromOldSavegame();
+	} else if (CheckSavegameVersion(94)) {
+		/* Unload and transfer are now mutual exclusive. */
+		Order *order;
+		FOR_ALL_ORDERS(order) {
+			if ((order->GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) == (OUFB_UNLOAD | OUFB_TRANSFER)) {
+				order->SetUnloadType(OUFB_TRANSFER);
+				order->SetLoadType(OLFB_NO_LOAD);
+			}
+		}
+
+		Vehicle *v;
+		FOR_ALL_VEHICLES(v) {
+			if ((v->current_order.GetUnloadType() & (OUFB_UNLOAD | OUFB_TRANSFER)) == (OUFB_UNLOAD | OUFB_TRANSFER)) {
+				v->current_order.SetUnloadType(OUFB_TRANSFER);
+				v->current_order.SetLoadType(OLFB_NO_LOAD);
+			}
+		}
 	}
 
 	return InitializeWindowsAndCaches();