diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-06 16:05:46 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-06 16:05:46 +0000 |
commit | 3839702b5dd49acb1b9ef6c04b65a64d9f5710d6 (patch) | |
tree | cc0d257c72cd7a6c6df750f215ba21dccbfbca02 /crawl-ref/source/files.cc | |
parent | 5d283404c9129d20b6d8f8c6dd2f051838e2d10d (diff) | |
download | crawl-ref-3839702b5dd49acb1b9ef6c04b65a64d9f5710d6.tar.gz crawl-ref-3839702b5dd49acb1b9ef6c04b65a64d9f5710d6.zip |
Fix for [2054894]: LOS not being reset while building a new level.
When I put this fix in a while ago, it caused lots of "floating monsters"
when changing levels, but that doesn't seem to happen anymore. Hopefully
that was due to a different bug which has been fixed meanwhile.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8927 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r-- | crawl-ref/source/files.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index de584c643d..979498b696 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -1108,6 +1108,10 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, } #endif + // Clear the show grid, to prevent us noticing things + // which were within the old LOS by new coordinates. + env.show.init(0); + // Try to open level savefile. #ifdef DEBUG_LEVEL_LOAD mprf(MSGCH_DIAGNOSTICS, "Try to open file %s", cha_fil.c_str()); @@ -1211,8 +1215,8 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, crawl_view.set_player_at(you.pos(), load_mode != LOAD_VISITOR); // This should fix the "monster occurring under the player" bug? - if (make_changes && mgrd(you.pos()) != NON_MONSTER) - monster_teleport(&menv[mgrd(you.pos())], true, true); + if (make_changes && monster_at(you.pos())) + monster_teleport(monster_at(you.pos()), true, true); // Actually "move" the followers if applicable. if (level_type_allows_followers(you.level_type) |