From d82ee4ebd849c7bfebb8d9998604e63767849efb Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 15 May 2007 20:12:11 +0000 Subject: Minor cleanups. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1477 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/files.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/files.cc') diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index ce75807379..cba3fc8936 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -848,9 +848,11 @@ static void clear_env_map() static void clear_clouds() { + for (int clouty = 0; clouty < MAX_CLOUDS; ++clouty) + delete_cloud( clouty ); for (int i = 0; i < GXM; i++) for (int j = 0; j < GYM; j++) - env.cgrid[i][j] = EMPTY_CLOUD; + ASSERT(env.cgrid[i][j] == EMPTY_CLOUD); } static void grab_followers(std::vector& followers) @@ -917,15 +919,10 @@ void load( int stair_taken, load_mode_type load_mode, bool was_a_labyrinth, you.prev_targ = MHITNOT; - // Don't delete clouds just because the player saved and restarted. + // We clear twice - on save and on load. + // Once would be enough... if (load_mode != LOAD_RESTART_GAME) - { - // XXX XXX FIXME shouldn't this just go into clear_clouds()? - for (int clouty = 0; clouty < MAX_CLOUDS; ++clouty) - delete_cloud( clouty ); - - ASSERT( env.cloud_no == 0 ); - } + clear_clouds(); // This block is to grab followers and save the old level to disk. if (load_mode == LOAD_ENTER_LEVEL) @@ -992,6 +989,7 @@ void load( int stair_taken, load_mode_type load_mode, bool was_a_labyrinth, if (just_created_level) clear_env_map(); + // Here's the second cloud clearing, on load (see above) if (load_mode != LOAD_RESTART_GAME) clear_clouds(); -- cgit v1.2.3-54-g00ecf