Loading

Revision differences

Old revision #phluxcqwoNew revision #pla01hx3i
34===================================================================  34===================================================================  
35--- src/saveload/afterload.cpp    (revision 27171)  35--- src/saveload/afterload.cpp    (revision 27171)  
36+++ src/saveload/afterload.cpp    (working copy)  36+++ src/saveload/afterload.cpp    (working copy)  
37@@ -2985,6 +2985,16 @@  37@@ -2985,6 +2985,18 @@
38     ResetSignalHandlers();  38     ResetSignalHandlers();  
39   39   
40     AfterLoadLinkGraphs();  40     AfterLoadLinkGraphs();  
41+  41+  
42+    /* Convert m1 bit 4 value for all industry tiles */  42+    /* Convert m1 bit 4 value for all industry tiles */  
43+    for (TileIndex t = 0; t < map_size; t++) {  43+    if (IsSavegameVersionBefore(195)) {
44+        /* It's not possible to know who was the original owner of a canal tile built under  44+        for (TileIndex t = 0; t < map_size; t++) {
45+        an Oil Rig tile from an old save game. To preserve savegame backward compatibility,  45+            /* It's not possible to know who was the original owner of a canal tile built under
46+        don't do anything about them. Old and new values for a given industry tile can co-exist. */  46+            an Oil Rig tile from an old save game. To preserve savegame backward compatibility,
47+        if (IsTileType(t, MP_INDUSTRY) && (GetWaterClass(t) != WATER_CLASS_CANAL)) {  47+            don't do anything about them. Old and new values for a given industry tile can co-exist. */
48+            SB(_m[t].m1, 4, 1, 1);  48+            if (IsTileType(t, MP_INDUSTRY) && (GetWaterClass(t) != WATER_CLASS_CANAL)) {
   49+                SB(_m[t].m1, 4, 1, 1);
   50+            }
49+        }  51+        }  
50+    }  52+    }  
51     return true;  53     return true;