summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/view.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/view.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/view.cc')
-rw-r--r--crawl-ref/source/view.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 61d2bb6821..84be11376f 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -1063,7 +1063,10 @@ void handle_monster_shouts(monsters* monster, bool force)
// shout.
if (mons_is_submerged(monster))
{
- monster->del_ench(ENCH_SUBMERGED);
+ if (!monster->del_ench(ENCH_SUBMERGED))
+ // Couldn't unsubmerge.
+ return;
+
if (you.can_see(monster))
{
monster->seen_context = "bursts forth shouting";