diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-15 20:12:11 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-05-15 20:12:11 +0000 |
commit | d82ee4ebd849c7bfebb8d9998604e63767849efb (patch) | |
tree | 9c60b216c873b3a257b3eee09cd7fc41296aa26c /crawl-ref/source/files.cc | |
parent | 778880771386e5f111aca28d397c5d32f3e7dca0 (diff) | |
download | crawl-ref-d82ee4ebd849c7bfebb8d9998604e63767849efb.tar.gz crawl-ref-d82ee4ebd849c7bfebb8d9998604e63767849efb.zip |
Minor cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1477 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r-- | crawl-ref/source/files.cc | 16 |
1 files changed, 7 insertions, 9 deletions
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<follower>& 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(); |