diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-05 12:08:02 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-05 12:08:02 +0000 |
commit | 523bc8d6c7cacfda666c513640b5f8ebc68d1c38 (patch) | |
tree | d36719f255202fd3f93cbfc3abc53e0bb129d544 /crawl-ref/source/monstuff.cc | |
parent | 85699d8241f73ca404e215fac0e6e1883ee7fcdf (diff) | |
download | crawl-ref-523bc8d6c7cacfda666c513640b5f8ebc68d1c38.tar.gz crawl-ref-523bc8d6c7cacfda666c513640b5f8ebc68d1c38.zip |
Fix [2650618]: polymorphing a damaged monster to a lower-HP form could
kill it.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9337 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 210000b566..c5c09072af 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2096,6 +2096,9 @@ bool monster_polymorph(monsters *monster, monster_type targetc, monster->hit_points = std::min(monster->max_hit_points, monster->hit_points); + // Don't kill it. + monster->hit_points = std::max(monster->hit_points, 1); + monster->speed_increment = 67 + random2(6); monster_drop_ething(monster); |