diff src/saveload/afterload.cpp @ 12999:07a634b14de8 draft

(svn r17493) -Codechange: store the depot index on the map
author rubidium <rubidium@openttd.org>
date Thu, 10 Sep 2009 14:33:07 +0000
parents c71e77a71cad
children 090bac35e7e4
line wrap: on
line diff
--- a/src/saveload/afterload.cpp
+++ b/src/saveload/afterload.cpp
@@ -13,6 +13,7 @@
 #include "../void_map.h"
 #include "../signs_base.h"
 #include "../roadstop_base.h"
+#include "../depot_base.h"
 #include "../window_func.h"
 #include "../fios.h"
 #include "../train.h"
@@ -1951,6 +1952,14 @@
 		FOR_ALL_STATIONS(st) UpdateStationAcceptance(st, false);
 	}
 
+	if (CheckSavegameVersion(128)) {
+		const Depot *d;
+		FOR_ALL_DEPOTS(d) {
+			_m[d->xy].m2 = d->index;
+			if (IsTileType(d->xy, MP_WATER)) _m[GetOtherShipDepotTile(d->xy)].m2 = d->index;
+		}
+	}
+
 	AfterLoadLabelMaps();
 
 	GamelogPrintDebug(1);