mirror of https://github.com/OpenTTD/OpenTTD
(svn r1574) -Fix [ 1105281 ] upgrade rail fails when train under bridge
parent
f0e616ea2b
commit
f8345b3fe6
|
@ -864,17 +864,25 @@ int32 DoConvertTunnelBridgeRail(uint tile, uint totype, bool exec)
|
||||||
} else if ((_map5[tile]&0xC6) == 0x80) {
|
} else if ((_map5[tile]&0xC6) == 0x80) {
|
||||||
uint starttile;
|
uint starttile;
|
||||||
int32 cost;
|
int32 cost;
|
||||||
|
uint z = TilePixelHeight(tile);
|
||||||
|
|
||||||
|
z += 8;
|
||||||
|
|
||||||
if (!CheckTileOwnership(tile)) return CMD_ERROR;
|
if (!CheckTileOwnership(tile)) return CMD_ERROR;
|
||||||
|
|
||||||
// railway bridge
|
// railway bridge
|
||||||
starttile = tile = FindEdgesOfBridge(tile, &endtile);
|
starttile = tile = FindEdgesOfBridge(tile, &endtile);
|
||||||
// Make sure there's no vehicle on the bridge
|
// Make sure there's no vehicle on the bridge
|
||||||
if ((v=FindVehicleBetween(tile, endtile, 0xff)) != NULL) {
|
if ((v=FindVehicleBetween(tile, endtile, z)) != NULL) {
|
||||||
VehicleInTheWayErrMsg(v);
|
VehicleInTheWayErrMsg(v);
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!EnsureNoVehicle(starttile) || !EnsureNoVehicle(endtile)) {
|
||||||
|
_error_message = STR_8803_TRAIN_IN_THE_WAY;
|
||||||
|
return CMD_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if ( (uint)(_map3_lo[tile] & 0xF) == totype) return CMD_ERROR;
|
if ( (uint)(_map3_lo[tile] & 0xF) == totype) return CMD_ERROR;
|
||||||
cost = 0;
|
cost = 0;
|
||||||
do {
|
do {
|
||||||
|
|
Loading…
Reference in New Issue