diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-26 03:29:14 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-26 03:29:14 +0000 |
commit | 8921c5b2703c3aa590026bbc8052ba129b6fc02c (patch) | |
tree | ba771cca8cf8a082e83ef0d0d20d61fc2df4e2fc /crawl-ref/source/player.cc | |
parent | 8467370eab3f93700463df6bc3bcfedba25b2f9c (diff) | |
download | crawl-ref-8921c5b2703c3aa590026bbc8052ba129b6fc02c.tar.gz crawl-ref-8921c5b2703c3aa590026bbc8052ba129b6fc02c.zip |
Fix "submerged" (hidden) trapdoor spiders being visible.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8762 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index aa708a0254..83436001bf 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2673,10 +2673,18 @@ bool player_monster_visible(const monsters *mon) // Treat monsters who are submerged due to drowning as visible, so // we get proper messages when they die. - if (mons_is_submerged(mon) && !mon->can_drown()) - return (false); + if (!mons_is_submerged(mon)) + return (true); - return (true); + const dungeon_feature_type feat = grd(mon->pos()); + + // Monsters can only drown in lava or water, so monsters that are + // "submerged" in other features (air elementals in air, trapdoor + // spiders in the floor) are exempt from this check. + if (feat < DNGN_LAVA || feat > DNGN_WATER_STUCK) + return (false); + + return (mon->can_drown()); } // Returns true if player is mesmerised by a given monster. |