summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-26 04:43:58 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-26 04:43:58 +0000
commit7124f889e3c585947d594aa38be346bc87c08069 (patch)
tree40f1109c243083f31c69f4cd4f545a638833c194 /crawl-ref/source/player.cc
parent8921c5b2703c3aa590026bbc8052ba129b6fc02c (diff)
downloadcrawl-ref-7124f889e3c585947d594aa38be346bc87c08069.tar.gz
crawl-ref-7124f889e3c585947d594aa38be346bc87c08069.zip
Simplify checks for grids containing water.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8763 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 83436001bf..0830998366 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -375,7 +375,7 @@ bool is_grid_dangerous(int grid)
{
return (!player_is_airborne()
&& (grid == DNGN_LAVA
- || (grid == DNGN_DEEP_WATER && !player_likes_water()) ));
+ || (grid == DNGN_DEEP_WATER && !player_likes_water())));
}
bool player_in_mappable_area( void )
@@ -2671,19 +2671,19 @@ bool player_monster_visible(const monsters *mon)
if (!player_see_invis() && mon->invisible())
return (false);
- // Treat monsters who are submerged due to drowning as visible, so
- // we get proper messages when they die.
if (!mons_is_submerged(mon))
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)
+ // Treat monsters who are submerged due to drowning as visible, so
+ // we get proper messages when they die. Monsters can only drown in
+ // lava or deep 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_DEEP_WATER)
return (false);
-
+
return (mon->can_drown());
}