From ef9621cf23810e12b8d3f77ba8de3538d4f02fc0 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Thu, 25 Dec 2008 03:05:05 +0000 Subject: [2455489] Fixing "dark" levels after crashes, due to the tile flavor being set after the level was saved. (This wasn't a problem until it started being saved recently.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7968 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 1 - crawl-ref/source/files.cc | 14 +++++++++++++- crawl-ref/source/misc.cc | 15 ++------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 55f4233b5e..b08372d1d3 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3968,7 +3968,6 @@ static bool _initialise(void) #ifdef USE_TILE tiles.initialise_items(); - TileNewLevel(newc); #endif set_cursor_enabled(false); diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 7dad243f4b..b0b894c16b 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1119,6 +1119,14 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, if (make_changes) _do_lost_items(old_level_type); +#ifdef USE_TILE + if (make_changes) + { + tiles.clear_minimap(); + tiles.load_dungeon(NULL, you.pos().x, you.pos().y); + } +#endif + // Try to open level savefile. #ifdef DEBUG_LEVEL_LOAD mprf(MSGCH_DIAGNOSTICS, "Try to open file %s", cha_fil.c_str()); @@ -1147,7 +1155,6 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, } #ifdef USE_TILE - tiles.load_dungeon(NULL, you.pos().x, you.pos().y); tile_init_default_flavour(); tile_clear_flavour(); #endif @@ -1240,6 +1247,11 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, place_transiting_items(); } +#ifdef USE_TILE + if (make_changes) + TileNewLevel(just_created_level); +#endif + _redraw_all(); _sanity_test_monster_inventory(); diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 415910a7e2..cdd0b3157f 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -1850,11 +1850,8 @@ void up_stairs(dungeon_feature_type force_stair, const coord_def stair_pos = you.pos(); -#ifdef USE_TILE - const bool newlevel = -#endif - load(stair_taken, LOAD_ENTER_LEVEL, old_level_type, - old_level, old_where); + load(stair_taken, LOAD_ENTER_LEVEL, old_level_type, + old_level, old_where); set_entry_cause(entry_cause, old_level_type); entry_cause = you.entry_cause; @@ -1888,10 +1885,6 @@ void up_stairs(dungeon_feature_type force_stair, // Tell stash-tracker and travel that we've changed levels. trackers_init_new_level(true); -#ifdef USE_TILE - TileNewLevel(newlevel); -#endif // USE_TILE - if (collect_travel_data) { // Update stair information for the stairs we just ascended, and the @@ -2455,10 +2448,6 @@ void down_stairs( int old_level, dungeon_feature_type force_stair, trackers_init_new_level(true); -#ifdef USE_TILE - TileNewLevel(newlevel); -#endif // USE_TILE - viewwindow(true, true); if (collect_travel_data) -- cgit v1.2.3-54-g00ecf