(svn r11421) -Fix [FS#1431]: do not use a function that asserts when wrapping around the map's edge when you use the wrapping (and MP_VOID tiles) to determine whether the bridge can be build.
authorrubidium
Mon, 12 Nov 2007 19:21:33 +0000
changeset 7871 4e5b81629881
parent 7870 e8f028f9895f
child 7872 29d1b577ac2e
(svn r11421) -Fix [FS#1431]: do not use a function that asserts when wrapping around the map's edge when you use the wrapping (and MP_VOID tiles) to determine whether the bridge can be build.
src/town_cmd.cpp
--- a/src/town_cmd.cpp	Mon Nov 12 18:32:04 2007 +0000
+++ b/src/town_cmd.cpp	Mon Nov 12 19:21:33 2007 +0000
@@ -925,12 +925,14 @@
 	uint8 bridge_length = 0;     // This value stores the length of the possible bridge
 	TileIndex bridge_tile = tile; // Used to store the other waterside
 
+	int delta = TileOffsByDiagDir(bridge_dir);
+
 	do {
 		if (bridge_length++ >= 11) {
 			/* Max 11 tile long bridges */
 			return false;
 		}
-		bridge_tile = TileAddByDiagDir(bridge_tile, bridge_dir);
+		bridge_tile += delta;
 	} while (IsWaterTile(bridge_tile));
 
 	/* no water tiles in between? */