summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monplace.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 00:02:52 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 00:02:52 +0000
commit510a5b2129d86a9c6591e701725379f6f1a6a67f (patch)
tree603269f3c6af78668bbb23a96ed19bf2ea19718b /crawl-ref/source/monplace.cc
parent9fd7f5bc149e7fa7ae2597bc39ca7fd348997424 (diff)
downloadcrawl-ref-510a5b2129d86a9c6591e701725379f6f1a6a67f.tar.gz
crawl-ref-510a5b2129d86a9c6591e701725379f6f1a6a67f.zip
Bug 1990763: if a monster tries to unsubmerge while under the player,
attempt to move it to an adjacent square before doing so. If there are no appropriate adjacent squares then try to make it stay submerged. If it can't stay submerged because the terrain changed then teleport it away. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5738 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r--crawl-ref/source/monplace.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index e5f46985b6..b007d5374b 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -159,7 +159,7 @@ bool monster_habitable_grid(int monster_class,
bool monster_can_submerge(const monsters *mons, dungeon_feature_type grid)
{
if (mons->type == MONS_TRAPDOOR_SPIDER && grid == DNGN_FLOOR)
- return (true);
+ return (trap_type_at_xy(mons->x, mons->y) == NUM_TRAPS);
// Zombies of watery critters can not submerge.
switch (mons_habitat(mons))