mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(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.
This commit is contained in:
parent
2c000f1546
commit
14c092faad
@ -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
|
uint8 bridge_length = 0; // This value stores the length of the possible bridge
|
||||||
TileIndex bridge_tile = tile; // Used to store the other waterside
|
TileIndex bridge_tile = tile; // Used to store the other waterside
|
||||||
|
|
||||||
|
int delta = TileOffsByDiagDir(bridge_dir);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (bridge_length++ >= 11) {
|
if (bridge_length++ >= 11) {
|
||||||
/* Max 11 tile long bridges */
|
/* Max 11 tile long bridges */
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bridge_tile = TileAddByDiagDir(bridge_tile, bridge_dir);
|
bridge_tile += delta;
|
||||||
} while (IsWaterTile(bridge_tile));
|
} while (IsWaterTile(bridge_tile));
|
||||||
|
|
||||||
/* no water tiles in between? */
|
/* no water tiles in between? */
|
||||||
|
Loading…
Reference in New Issue
Block a user