Make sure compute_path/line_of_movement destination is inside map

Fixes #827