(svn r8689) -Fix [FS#613] (r8619): crash when an old savegame had buoys on the northern edge of the map.
authorrubidium
Mon, 12 Feb 2007 12:52:37 +0000
changeset 5986 6364a078d30c
parent 5985 7e9406c94288
child 5987 0e8e1f4e5e4f
(svn r8689) -Fix [FS#613] (r8619): crash when an old savegame had buoys on the northern edge of the map.
src/openttd.cpp
--- a/src/openttd.cpp	Mon Feb 12 09:01:40 2007 +0000
+++ b/src/openttd.cpp	Mon Feb 12 12:52:37 2007 +0000
@@ -1776,6 +1776,15 @@
 		}
 	}
 
+	/* Buoys do now store the owner of the previous water tile, which can never
+	 * be OWNER_NONE. So replace OWNER_NONE with OWNER_WATER. */
+	if (CheckSavegameVersion(46)) {
+		Station *st;
+		FOR_ALL_STATIONS(st) {
+			if (st->IsBuoy() && IsTileOwner(st->xy, OWNER_NONE)) SetTileOwner(st->xy, OWNER_WATER);
+		}
+	}
+
 	return true;
 }