summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 11:07:27 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-21 11:07:27 +0000
commit13ce21e448fd20b8e2eb25e48c19a920bc55d69b (patch)
tree7348eb38eee9c5e66dbbd585c46af949390c03f0 /crawl-ref
parent7d317e6fc0e6847a95d0c59888400f135af66cd7 (diff)
downloadcrawl-ref-13ce21e448fd20b8e2eb25e48c19a920bc55d69b.tar.gz
crawl-ref-13ce21e448fd20b8e2eb25e48c19a920bc55d69b.zip
Don't let ghouls or necrophages eat skeletons, so as to avoid an assertion
where the code attempts to skeletonize a skelton (and also it seems weird for them to gobble up something with no flesh on it). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8652 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/mon-util.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index c916a4c5fb..b5a524d127 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -4964,6 +4964,9 @@ bool monsters::eat_corpse(item_def &item, int near)
if (!mons_eats_corpses(this))
return (false);
+ if (item.sub_type != CORPSE_BODY)
+ return (false);
+
hit_points += 1 + random2(mons_weight(item.plus)) / 100;
// Limited growth factor here -- should 77 really be the cap? {dlb}:
@@ -5080,7 +5083,7 @@ bool monsters::pickup_item(item_def &item, int near, bool force)
case OBJ_ARMOUR:
return pickup_armour(item, near, force);
case OBJ_CORPSES:
- return eat_corpse(item, near);
+ return eat_corpse(item, near || force);
case OBJ_MISCELLANY:
return pickup_misc(item, near);
case OBJ_GOLD: