diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-09 08:16:08 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-09 08:16:08 +0000 |
commit | 5e45d94ad52ad1263610f24693c99e3bf2675af5 (patch) | |
tree | d097b47d54e62f1648372b0db7408bb9029d6046 /crawl-ref/source/view.cc | |
parent | 3ce71fe4a73f6123c7f903805b60e5798ccef984 (diff) | |
download | crawl-ref-5e45d94ad52ad1263610f24693c99e3bf2675af5.tar.gz crawl-ref-5e45d94ad52ad1263610f24693c99e3bf2675af5.zip |
Don't let the Level map wizard command "teleport to target" place you
on an invalid square.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5650 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 1c41232987..da1f7fdc16 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -3418,7 +3418,10 @@ void show_map( coord_def &spec_place, bool travel_mode ) { if (!you.wizard) break; - you.moveto(start_x + curs_x - 1, start_y + curs_y - 1); + const coord_def pos(start_x + curs_x - 1, start_y + curs_y - 1); + if (!in_bounds(pos)) + break; + you.moveto(pos); map_alive = false; break; } |