summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-27 22:13:06 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-27 22:13:06 +0000
commit498e7da04ff2c3bd22d0e160892c3c46b950a34e (patch)
tree2eabcc58fb7f6ec75f3e256761e143188a58669d /crawl-ref
parent18c6841dbd2281ea14161c625e893afa469a090e (diff)
downloadcrawl-ref-498e7da04ff2c3bd22d0e160892c3c46b950a34e.tar.gz
crawl-ref-498e7da04ff2c3bd22d0e160892c3c46b950a34e.zip
Fix [2646326]: restore LOS properly after using the applicator functions
to visit a different level. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9264 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/files.cc7
-rw-r--r--crawl-ref/source/view.cc31
-rw-r--r--crawl-ref/source/view.h1
3 files changed, 24 insertions, 15 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index ecaa0c1abf..8f182126e0 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -1075,7 +1075,7 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode,
}
you.prev_targ = MHITNOT;
- you.prev_grd_targ = coord_def(0, 0);
+ you.prev_grd_targ.reset();
// We clear twice - on save and on load.
// Once would be enough...
@@ -1391,7 +1391,7 @@ void _save_level(int level_saved, level_area_type old_ltype,
false );
you.prev_targ = MHITNOT;
- you.prev_grd_targ = coord_def(0, 0);
+ you.prev_grd_targ.reset();
FILE *saveFile = fopen(cha_fil.c_str(), "wb");
@@ -1719,6 +1719,9 @@ static void _restore_level(const level_id &original)
load( DNGN_STONE_STAIRS_DOWN_I, LOAD_VISITOR,
you.level_type, you.your_level, you.where_are_you );
+
+ // Rebuild the show grid, which was cleared out before.
+ calc_show_los();
}
// Given a level returns true if the level has been created already
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 37886423ce..6c5b84a143 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -5071,6 +5071,23 @@ static void _debug_pane_bounds()
#endif
}
+void calc_show_los()
+{
+ if (!crawl_state.arena && !crawl_state.arena_suspended)
+ {
+ // Must be done first.
+ losight(env.show, grd, you.pos());
+
+ // What would be visible, if all of the translucent walls were
+ // made opaque.
+ losight(env.no_trans_show, grd, you.pos(), true);
+ }
+ else
+ {
+ losight(env.show, grd, crawl_view.glosc());
+ }
+}
+
//---------------------------------------------------------------
//
// viewwindow -- now unified and rolled into a single pass
@@ -5096,19 +5113,7 @@ void viewwindow(bool draw_it, bool do_updates)
int count_x, count_y;
- if (!crawl_state.arena && !crawl_state.arena_suspended)
- {
- // Must be done first.
- losight(env.show, grd, you.pos());
-
- // What would be visible, if all of the translucent walls were
- // made opaque.
- losight(env.no_trans_show, grd, you.pos(), true);
- }
- else
- {
- losight(env.show, grd, crawl_view.glosc());
- }
+ calc_show_los();
#ifdef USE_TILE
tile_draw_floor();
diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h
index 4f6f78d4f5..4cba2a9dbb 100644
--- a/crawl-ref/source/view.h
+++ b/crawl-ref/source/view.h
@@ -216,6 +216,7 @@ void view_update_at(const coord_def &pos);
void flash_monster_colour(const monsters *mon, unsigned char fmc_colour,
int fmc_delay);
#endif
+void calc_show_los();
void viewwindow(bool draw_it, bool do_updates);
void update_monsters_in_view();
void flush_comes_into_view();