mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-07 06:39:08 +00:00
(svn r11015) -Fix [FS#1166]: towns would build bridges through eachother.
This commit is contained in:
parent
98a3b8abfa
commit
c81eafdaa0
@ -1084,12 +1084,11 @@ build_road_and_exit:
|
|||||||
|
|
||||||
/* Quit if it selecting an appropiate bridge type fails a large number of times. */
|
/* Quit if it selecting an appropiate bridge type fails a large number of times. */
|
||||||
j = 22;
|
j = 22;
|
||||||
{
|
|
||||||
int32 bridge_len = GetBridgeLength(tile, tmptile);
|
|
||||||
do {
|
do {
|
||||||
byte bridge_type = RandomRange(MAX_BRIDGES - 1);
|
byte bridge_type = RandomRange(MAX_BRIDGES - 1);
|
||||||
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
|
/* Can we actually build the bridge? */
|
||||||
if (CmdSucceeded(DoCommand(tile, tmptile, bridge_type | ((0x80 | ROADTYPES_ROAD) << 8), DC_EXEC | DC_AUTO, CMD_BUILD_BRIDGE)))
|
if (CmdSucceeded(DoCommand(tile, tmptile, bridge_type | ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO, CMD_BUILD_BRIDGE))) {
|
||||||
|
DoCommand(tile, tmptile, bridge_type | ((0x80 | ROADTYPES_ROAD) << 8), DC_EXEC | DC_AUTO, CMD_BUILD_BRIDGE);
|
||||||
_grow_town_result = -1;
|
_grow_town_result = -1;
|
||||||
|
|
||||||
/* obviously, if building any bridge would fail, there is no need to try other bridge-types */
|
/* obviously, if building any bridge would fail, there is no need to try other bridge-types */
|
||||||
@ -1097,7 +1096,6 @@ build_road_and_exit:
|
|||||||
}
|
}
|
||||||
} while (--j != 0);
|
} while (--j != 0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/** Returns "growth" if a house was built, or no if the build failed.
|
/** Returns "growth" if a house was built, or no if the build failed.
|
||||||
* @param t town to inquiry
|
* @param t town to inquiry
|
||||||
|
Loading…
Reference in New Issue
Block a user