Select the tile with the most damaged part when trying to repair in a vehicle tile that has all its parts healthy.

Also includes PR #4437, because it provided a nice framework to build from.