summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-06-25 09:46:18 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-06-25 10:10:24 -0400
commit90b49e12abdad3ea238b1c234d0fe919a47e40fd (patch)
treefcbd8eba9972a150ddde186abc2981529ec8cb3e /crawl-ref/source/misc.cc
parentd0042cdcca6df175a9068764c8c37a6cb930919d (diff)
downloadcrawl-ref-90b49e12abdad3ea238b1c234d0fe919a47e40fd.tar.gz
crawl-ref-90b49e12abdad3ea238b1c234d0fe919a47e40fd.zip
Don't allow infinite kraken simulacra.
Or of any other monster with M_NO_SKELETON.
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 0ccbaa90cf..ecdc0f883e 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -142,7 +142,12 @@ int get_max_corpse_chunks(monster_type mons_class)
return mons_weight(mons_class) / 150;
}
-void turn_corpse_into_skeleton(item_def &item)
+/** Skeletonise this corpse.
+ *
+ * @param item the corpse to be turned into a skeleton.
+ * @returns whether a valid skeleton could be made.
+ */
+bool turn_corpse_into_skeleton(item_def &item)
{
ASSERT(item.base_type == OBJ_CORPSES);
ASSERT(item.sub_type == CORPSE_BODY);
@@ -150,11 +155,12 @@ void turn_corpse_into_skeleton(item_def &item)
// Some monsters' corpses lack the structure to leave skeletons
// behind.
if (!mons_skeleton(item.mon_type))
- return;
+ return false;
item.sub_type = CORPSE_SKELETON;
item.special = FRESHEST_CORPSE; // reset rotting counter
item.colour = LIGHTGREY;
+ return true;
}
static void _maybe_bleed_monster_corpse(const item_def corpse)