From dfc3164140baf959c74be84e323534999c91958c Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 25 Jan 2009 03:50:05 +0000 Subject: Monsters whose primary habitat is water or lava can't drown, even if they're lacking asphyxiation resistance. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8736 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mon-util.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crawl-ref/source/mon-util.cc') diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index 6ebf1349fc..6f9be5609f 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -3587,6 +3587,18 @@ bool monsters::is_habitable_feat(dungeon_feature_type actual_grid) const bool monsters::can_drown() const { + // Presumeably a shark in lava or a lavafish in deep water could + // drown, but that should never happen, so this simple check should + // be enough. + switch (mons_primary_habitat(this)) + { + case HT_WATER: + case HT_LAVA: + return (false); + default: + break; + } + // Mummies can fall apart in water or be incinerated in lava. // Ghouls, vampires, and demons can drown in water or lava. Others // just "sink like a rock", to never be seen again. -- cgit v1.2.3-54-g00ecf