summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-23 09:31:29 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-23 09:31:29 +0000
commitcc7766e30b5e50a37ffb1bff97ed84585261e433 (patch)
tree216a1734e6b2fe18b255065b508b1d38297a2b6f /crawl-ref/source/misc.cc
parent639c8fe55ef025dbf4e75d909b5ce82106580c21 (diff)
downloadcrawl-ref-cc7766e30b5e50a37ffb1bff97ed84585261e433.tar.gz
crawl-ref-cc7766e30b5e50a37ffb1bff97ed84585261e433.zip
When randomly leaving skeletons from butchery or blood potion bottling,
make the skeleton from the original corpse instead of the copy, so that it gets the same item slot as the corpse and equip_undead() on the skeleton works properly. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8709 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 70f14eb31b..9c38fb5ac0 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -181,18 +181,17 @@ void turn_corpse_into_chunks(item_def &item)
void turn_corpse_into_skeleton_and_chunks(item_def &item)
{
+ item_def chunks = item;
+
if (mons_skeleton(item.plus))
+ turn_corpse_into_skeleton(item);
+
+ int o = get_item_slot();
+ if (o != NON_ITEM)
{
- int o = get_item_slot();
- if (o != NON_ITEM)
- {
- item_def skel = item;
- turn_corpse_into_skeleton(skel);
- copy_item_to_grid(skel, you.pos());
- }
+ turn_corpse_into_chunks(chunks);
+ copy_item_to_grid(chunks, you.pos());
}
-
- turn_corpse_into_chunks(item);
}
// Initialize blood potions with a vector of timers.
@@ -916,18 +915,17 @@ void turn_corpse_into_blood_potions(item_def &item)
void turn_corpse_into_skeleton_and_blood_potions(item_def &item)
{
+ item_def blood_potions = item;
+
if (mons_skeleton(item.plus))
+ turn_corpse_into_skeleton(item);
+
+ int o = get_item_slot();
+ if (o != NON_ITEM)
{
- int o = get_item_slot();
- if (o != NON_ITEM)
- {
- item_def skel = item;
- turn_corpse_into_skeleton(skel);
- copy_item_to_grid(skel, you.pos());
- }
+ turn_corpse_into_blood_potions(blood_potions);
+ copy_item_to_grid(blood_potions, you.pos());
}
-
- turn_corpse_into_blood_potions(item);
}
// A variation of the mummy curse: