Make sure compute_path/line_of_movement destination is inside map

Fixes #827
Merge pull request #831 from dorkster/bugfixes

Make sure compute_path/line_of_movement destination is inside map