mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
(svn r10081) -Fix [FS851]: towns/AIs didn't build bridges anymore (boekabart).
This commit is contained in:
parent
ff40914740
commit
7767e466e5
@ -2888,7 +2888,7 @@ static inline void AiCheckBuildRoadBridgeHere(AiRoadFinder *arf, TileIndex tile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Is building a (rail)bridge possible at this place (type doesn't matter)?
|
// Is building a (rail)bridge possible at this place (type doesn't matter)?
|
||||||
if (CmdFailed(DoCommand(tile_new, tile, 0x8000, DC_AUTO, CMD_BUILD_BRIDGE)))
|
if (CmdFailed(DoCommand(tile_new, tile, ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO, CMD_BUILD_BRIDGE)))
|
||||||
return;
|
return;
|
||||||
AiBuildRoadRecursive(arf, tile_new, dir2);
|
AiBuildRoadRecursive(arf, tile_new, dir2);
|
||||||
|
|
||||||
@ -3038,13 +3038,13 @@ do_some_terraform:
|
|||||||
*/
|
*/
|
||||||
for (i = 10; i != 0; i--) {
|
for (i = 10; i != 0; i--) {
|
||||||
if (CheckBridge_Stuff(i, bridge_len)) {
|
if (CheckBridge_Stuff(i, bridge_len)) {
|
||||||
int32 cost = DoCommand(tile, p->ai.cur_tile_a, i + (0x80 << 8), DC_AUTO, CMD_BUILD_BRIDGE);
|
int32 cost = DoCommand(tile, p->ai.cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO, CMD_BUILD_BRIDGE);
|
||||||
if (!CmdFailed(cost) && cost < (p->player_money >> 5)) break;
|
if (!CmdFailed(cost) && cost < (p->player_money >> 5)) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build it
|
// Build it
|
||||||
DoCommand(tile, p->ai.cur_tile_a, i + (0x80 << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
|
DoCommand(tile, p->ai.cur_tile_a, i + ((0x80 | ROADTYPES_ROAD) << 8), DC_AUTO | DC_EXEC, CMD_BUILD_BRIDGE);
|
||||||
|
|
||||||
p->ai.state_counter = 0;
|
p->ai.state_counter = 0;
|
||||||
} else if (arf.best_ptr[0] & 0x40) {
|
} else if (arf.best_ptr[0] & 0x40) {
|
||||||
|
@ -1096,7 +1096,7 @@ build_road_and_exit:
|
|||||||
do {
|
do {
|
||||||
byte bridge_type = RandomRange(MAX_BRIDGES - 1);
|
byte bridge_type = RandomRange(MAX_BRIDGES - 1);
|
||||||
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
|
if (CheckBridge_Stuff(bridge_type, bridge_len)) {
|
||||||
if (!CmdFailed(DoCommand(tile, tmptile, 0x8000 + bridge_type, DC_EXEC | DC_AUTO, CMD_BUILD_BRIDGE)))
|
if (!CmdFailed(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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user