From 3890b0dcf7b0b897edc1b04099f56709c18b012c Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Wed, 4 Nov 2009 22:16:26 -0800 Subject: show.cc: Fix show_def::init() arena crash. --- crawl-ref/source/show.cc | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/show.cc') 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)); + } } -- cgit v1.2.3-54-g00ecf