Don't buy.
If you are not going to back out, see if the roof and ceilings are held up by wood or metal beams.
If wood, see above or take the cost of a total rebuild away from your offer price.
Same for Windows, doors, and anything else made of wood.
Is your furniture made of wood?
My next door neighbour's roof collapsed right onto their bed.
They were on holiday so they didn't get killed.