diff options
author | Neil Moore <neil@s-z.org> | 2013-05-07 19:10:54 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-05-07 19:10:54 -0400 |
commit | da99e5649b07fd211f9951b24e469840c7d84ad3 (patch) | |
tree | 55a95381415959072b390390a697badba4f162f9 /crawl-ref/source/view.cc | |
parent | dc88342323d0bbeac2ff5640d0e1747c205ad5c2 (diff) | |
download | crawl-ref-da99e5649b07fd211f9951b24e469840c7d84ad3.tar.gz crawl-ref-da99e5649b07fd211f9951b24e469840c7d84ad3.zip |
Don't crash after some view-flashes while travelling.
We often pass the address of an auto-storage targetter to
flash_view_delay (and once directly to flash_view). If the call to
viewwindow() actually displays the flash, that's fine. However, if
viewwindow returns early (for example, because the player is travelling
with a delay of -1), the address in you.flash_where could stick around
until the *next* call to viewwindow, at which point the targetter is
out of scope and we get a crash.
To reproduce: set runrest_ignore_monster += wretched:1 and
travel_delay = -1 , create and alert a wretched star, and travel
(x<movement><enter>) with it in view. It usually doesn't take long for
the star to pulse with eldritch light and crash the game, at least in
the webtiles build.
Fix this by having flash_view_delay() reset the flash after the delay.
Do the same in cast_los_attack_spell, after the more(); ignite_poison
already did this, so doesn't need to be fixed.
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 6da7d668d0..179fed7772 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -753,6 +753,7 @@ void flash_view_delay(colour_t colour, int flash_delay, targetter *where) } delay(flash_delay); + flash_view(0); } static void _debug_pane_bounds() |