(svn r3158) - PBS: [ 1252192 ] Fix an assertion failure due to possible junk data in pre-PBS savegames. This will not correct pre-PBS savegames loaded and saved since PBS was introduced. (thanks glx)
authorpeter1138
Wed, 09 Nov 2005 09:16:08 +0000
changeset 2620 3693073fef99
parent 2619 1b20d578a660
child 2621 2bacc2e9c68f
(svn r3158) - PBS: [ 1252192 ] Fix an assertion failure due to possible junk data in pre-PBS savegames. This will not correct pre-PBS savegames loaded and saved since PBS was introduced. (thanks glx)
openttd.c
--- a/openttd.c	Wed Nov 09 07:25:55 2005 +0000
+++ b/openttd.c	Wed Nov 09 09:16:08 2005 +0000
@@ -1277,6 +1277,9 @@
 				CLRBIT(_m[tile].m4, 2);
 				SETBIT(_m[tile].m4, 3);
 			}
+			// Clear possible junk data in PBS bits.
+			if (IsTileType(tile, MP_RAILWAY) && !HASBIT(_m[tile].m5, 7))
+				SB(_m[tile].m4, 4, 4, 0);
 		} END_TILE_LOOP(tile, MapSizeX(), MapSizeY(), 0);
 	}