diff options
author | rubidium <rubidium@openttd.org> | 2007-11-12 19:21:33 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-11-12 19:21:33 +0000 |
commit | 14c092faadf8e2b37f26fcdc9913650fae0ab184 (patch) | |
tree | 63ab6ebae928d557e91f34a73091811969d84f67 /src | |
parent | 2c000f1546b1a750e138fc1f921dfdac6afd252e (diff) | |
download | openttd-14c092faadf8e2b37f26fcdc9913650fae0ab184.tar.xz |
(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.
Diffstat (limited to 'src')
-rw-r--r-- | src/town_cmd.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index e6891accd..a8ce3f112 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -925,12 +925,14 @@ static bool GrowTownWithBridge(const Town *t, TileIndex tile, DiagDirection brid 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? */ |