summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-28 21:46:27 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-28 21:46:27 +0000
commitfc09d2de4c77399a6562507ad99c394d93c5cee9 (patch)
treeb957a366c7ca56c83a0e3075aed0e738a0abf5ae /crawl-ref/source/monstuff.cc
parent0ffadca40b94c481141887d294d311ff738c2ad1 (diff)
downloadcrawl-ref-fc09d2de4c77399a6562507ad99c394d93c5cee9.tar.gz
crawl-ref-fc09d2de4c77399a6562507ad99c394d93c5cee9.zip
Fix 2004501: buggy ?identify; also finally properly id ?identify itself
after a successful identification (if there are several). Fix 2004793: wandering mushroom flees - for real, this time (I hope). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6189 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index c1a9155ffd..e9e0e56d00 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2009,7 +2009,7 @@ void behaviour_event(monsters *mon, int event, int src,
|| ((wontAttack != sourceWontAttack || isSmart)
&& !mons_is_fleeing(mon) && !mons_is_panicking(mon)))
{
- // (Plain) plants and fungi cannot flee or fight back.
+ // (Plain) plants and fungi cannot fight back.
if (mon->type == MONS_FUNGUS || mon->type == MONS_PLANT)
return;
@@ -3008,8 +3008,13 @@ static void _handle_behaviour(monsters *mon)
mon->target_y = menv[mon->foe].y;
}
- if (isHurt && !isSmart && isMobile)
+ // Stupid monsters, plants or nonliving monsters cannot flee.
+ if (isHurt && !isSmart && isMobile
+ && mons_class_holiness(mon->type) != MH_PLANT
+ && mons_class_holiness(mon->type) != MH_NONLIVING)
+ {
new_beh = BEH_FLEE;
+ }
break;
case BEH_WANDER:
@@ -3366,6 +3371,13 @@ static void _handle_behaviour(monsters *mon)
break;
case BEH_CORNERED:
+ // Plants or nonliving monsters cannot fight back.
+ if (mons_class_holiness(mon->type) == MH_PLANT
+ || mons_class_holiness(mon->type) == MH_NONLIVING)
+ {
+ break;
+ }
+
if (isHealthy)
new_beh = BEH_SEEK;