Let x=distance apart of the walls which are in parallel. Let h=difference in height of the walls.
The horizontal distance along the wall between the cat and bird is 34-30=4m.
The horizontal distance between the walls (their distance apart) is x.
The vertical distance (their relative heights) is h.
The shortest distance between the cat and bird is √(x^2+h^2+16).
If the walls are of equal height, h=0. If x=3m, the distance=√(9+16)=√25=5m.
If h=2m, x=4m, this distance is √(16+4+16)=√36=6m.
If h=3m, x=12m, it's √(144+9+16)=√169=13m.
If the walls are perpendicular and of the same height then the answer is √(30^2+34^2)=45.34m approx.
If the walls are at an angle, we need to know what that angle is.