summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/show.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-04 22:16:26 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-04 22:16:26 -0800
commit3890b0dcf7b0b897edc1b04099f56709c18b012c (patch)
tree4622c78f526fea13c426b435d00115df80684bc1 /crawl-ref/source/show.cc
parentc73c1dad0a1d80a014ef59087aeee9f0e6171cf2 (diff)
downloadcrawl-ref-3890b0dcf7b0b897edc1b04099f56709c18b012c.tar.gz
crawl-ref-3890b0dcf7b0b897edc1b04099f56709c18b012c.zip
show.cc: Fix show_def::init() arena crash.
Diffstat (limited to 'crawl-ref/source/show.cc')
-rw-r--r--crawl-ref/source/show.cc17
1 files changed, 15 insertions, 2 deletions
diff --git a/crawl-ref/source/show.cc b/crawl-ref/source/show.cc
index b75a90a13c..a7757f0165 100644
--- a/crawl-ref/source/show.cc
+++ b/crawl-ref/source/show.cc
@@ -4,6 +4,7 @@
#include "cloud.h"
#include "colour.h"
+#include "coord.h"
#include "coordit.h"
#include "directn.h"
#include "feature.h"
@@ -228,6 +229,18 @@ void show_def::init()
grid.init(show_type());
backup.init(show_type());
- for (radius_iterator ri(you.pos(), LOS_RADIUS); ri; ++ri)
- update_at(*ri, grid2show(*ri));
+ if (crawl_state.arena)
+ {
+ const coord_def &ul = crawl_view.glos1; // Upper left
+ const coord_def &lr = crawl_view.glos2; // Lower right
+
+ for (rectangle_iterator ri(ul, lr); ri; ++ri)
+ update_at(*ri, grid2show(*ri));
+ }
+ else
+ {
+ ASSERT(in_bounds(you.pos()));
+ for (radius_iterator ri(you.pos(), LOS_RADIUS); ri; ++ri)
+ update_at(*ri, grid2show(*ri));
+ }
}