summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/view.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-12-27 16:57:38 -0500
committerNeil Moore <neil@s-z.org>2012-12-27 16:58:18 -0500
commit164869b0072d6c8063f48123961969114c294e44 (patch)
treed1edc3de0b1d7f46a6348b72fd5125ec9d6bde82 /crawl-ref/source/view.cc
parenta84578cce05d8cad2da3afa77fc5a7c7315b5080 (diff)
downloadcrawl-ref-164869b0072d6c8063f48123961969114c294e44.tar.gz
crawl-ref-164869b0072d6c8063f48123961969114c294e44.zip
Don't crash 'monster' when monsters flash the view.
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r--crawl-ref/source/view.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index d84ddb6bde..90c5246524 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -970,6 +970,10 @@ void viewwindow(bool show_updates, bool tiles_only)
screen_cell_t *cell(crawl_view.vbuf);
+ // The buffer is not initialised when run from 'monster'; abort early.
+ if (!cell)
+ return;
+
// Update the animation of cells only once per turn.
const bool anim_updates = (you.last_view_update != you.num_turns);
// Except for elemental colours, which should be updated every refresh.