summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-20 05:17:48 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-20 05:17:48 +0000
commite6ce8067c586ae8324ee57e837aca39beef8ac95 (patch)
treef02a6f700383d43372a4405dba109330f5eb0e60 /crawl-ref/source/player.cc
parente1962aec973373a236a4894f78c97cd33e266394 (diff)
downloadcrawl-ref-e6ce8067c586ae8324ee57e837aca39beef8ac95.tar.gz
crawl-ref-e6ce8067c586ae8324ee57e837aca39beef8ac95.zip
Make player::is_habitable_feat() deal with deep water and lava.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7876 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 082f504a07..1a47d3c4b1 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5581,7 +5581,19 @@ bool actor::is_habitable(const coord_def &_pos) const
bool player::is_habitable_feat(dungeon_feature_type actual_grid) const
{
- return can_pass_through_feat(actual_grid);
+ if (!can_pass_through_feat(actual_grid))
+ return (false);
+
+ if (airborne())
+ return (true);
+
+ if (actual_grid == DNGN_LAVA
+ || actual_grid == DNGN_DEEP_WATER && !can_swim())
+ {
+ return (false);
+ }
+
+ return (true);
}
bool actor::handle_trap()