fixed getDistance which caused teleportation over about three tiles
distance