Theoretical implementation of getClosestTerrainExit

Let's hope it works. It should, I guess. But you know, it never works on
the first try.