equal
deleted
inserted
replaced
740 Omit tile and endtile, since these are already checked, thus solving the problem |
740 Omit tile and endtile, since these are already checked, thus solving the problem |
741 of bridges over water, or higher bridges, where z is not increased, eg level bridge |
741 of bridges over water, or higher bridges, where z is not increased, eg level bridge |
742 */ |
742 */ |
743 tile += direction ? TILE_XY(0, 1) : TILE_XY( 1,0); |
743 tile += direction ? TILE_XY(0, 1) : TILE_XY( 1,0); |
744 endtile -= direction ? TILE_XY(0, 1) : TILE_XY( 1,0); |
744 endtile -= direction ? TILE_XY(0, 1) : TILE_XY( 1,0); |
745 if ((v = FindVehicleBetween(tile, endtile, TilePixelHeight(tile) + 8)) != NULL) { |
745 /* Bridges on slopes might have their Z-value offset..correct this */ |
|
746 if ((v = FindVehicleBetween(tile, endtile, TilePixelHeight(tile) + 8 + GetCorrectTileHeight(tile))) != NULL) { |
746 VehicleInTheWayErrMsg(v); |
747 VehicleInTheWayErrMsg(v); |
747 return CMD_ERROR; |
748 return CMD_ERROR; |
748 } |
749 } |
749 |
750 |
750 /* Put the tiles back to start/end position */ |
751 /* Put the tiles back to start/end position */ |
802 |
803 |
803 return ((((endtile - tile) >> (direction?8:0))&0xFF)+1) * _price.clear_bridge; |
804 return ((((endtile - tile) >> (direction?8:0))&0xFF)+1) * _price.clear_bridge; |
804 } |
805 } |
805 |
806 |
806 static int32 ClearTile_TunnelBridge(uint tile, byte flags) { |
807 static int32 ClearTile_TunnelBridge(uint tile, byte flags) { |
807 int32 ret; |
|
808 byte m5 = _map5[tile]; |
808 byte m5 = _map5[tile]; |
809 |
809 |
810 if ((m5 & 0xF0) == 0) { |
810 if ((m5 & 0xF0) == 0) { |
811 if (flags & DC_AUTO) |
811 if (flags & DC_AUTO) |
812 return_cmd_error(STR_5006_MUST_DEMOLISH_TUNNEL_FIRST); |
812 return_cmd_error(STR_5006_MUST_DEMOLISH_TUNNEL_FIRST); |
|
813 |
813 return DoClearTunnel(tile, flags); |
814 return DoClearTunnel(tile, flags); |
814 } else if (m5 & 0x80) { |
815 } else if (m5 & 0x80) { |
815 if (flags & DC_AUTO) |
816 if (flags & DC_AUTO) |
816 return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); |
817 return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); |
817 |
818 |
818 ret = DoClearBridge(tile, flags); |
819 return DoClearBridge(tile, flags); |
819 if (ret == CMD_ERROR) |
820 } |
820 return CMD_ERROR; |
821 |
821 |
822 return CMD_ERROR; |
822 return ret; |
|
823 } else { |
|
824 return CMD_ERROR; |
|
825 } |
|
826 } |
823 } |
827 |
824 |
828 int32 DoConvertTunnelBridgeRail(uint tile, uint totype, bool exec) |
825 int32 DoConvertTunnelBridgeRail(uint tile, uint totype, bool exec) |
829 { |
826 { |
830 uint endtile; |
827 uint endtile; |