diff options
author | Neil Moore <neil@s-z.org> | 2012-10-11 18:35:42 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-10-11 18:35:42 -0400 |
commit | fbe0e60f27f7b258f28a38be26635b6f020799d6 (patch) | |
tree | 9c2519708b52eea411ae0072123eab3c42ef88ff /crawl-ref/source/view.cc | |
parent | 4e8099c9fb3c8b309f4caac454f718cfb7ddbd48 (diff) | |
download | crawl-ref-fbe0e60f27f7b258f28a38be26635b6f020799d6.tar.gz crawl-ref-fbe0e60f27f7b258f28a38be26635b6f020799d6.zip |
Don't crash when calling viewwindow() at (0,0).
This was happening (sometimes) when interlevel travel was interrupted
by a MSGCH_ERROR message during level-gen. Now we treat this like the
other case where your position is (0,0) (viz. step from time).
The underlying problem causing those messages is still there, but now
the user should get just an error message and not a crash.
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 4ad05a9890..b0f1f2f7de 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -962,7 +962,9 @@ static bool _show_terrain = false; //--------------------------------------------------------------- void viewwindow(bool show_updates, bool tiles_only) { - if (you.duration[DUR_TIME_STEP]) + // The player could be at (0,0) if we are called during level-gen; this can + // happen via mpr -> interrupt_activity -> stop_delay -> runrest::stop + if (you.duration[DUR_TIME_STEP] || you.pos().origin()) return; screen_cell_t *cell(crawl_view.vbuf); |