summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-22 05:40:53 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-22 05:40:53 +0000
commit93e3e93ac5ac9503f7f55793b3c529a12b1d30b2 (patch)
treeaa53f846c64a7af8de52e4f0dcdd89c292af8939
parentc4779b6bb58812ba43eb0d32d86b6293681a0bd9 (diff)
downloadcrawl-ref-93e3e93ac5ac9503f7f55793b3c529a12b1d30b2.tar.gz
crawl-ref-93e3e93ac5ac9503f7f55793b3c529a12b1d30b2.zip
Fix wizard-mode corpse force-feeding leading to crash on game reload if the
force-fed monster skeletonizes the corpse. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8677 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/debug.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 28477c50dc..fa1d9b1b0e 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -5028,6 +5028,10 @@ void wizard_give_monster_item(monsters *mon)
mitm[index] = item;
+ if (item.base_type == OBJ_CORPSES)
+ // In case corpse gets skeletonized.
+ move_item_to_grid(&index, mon->pos());
+
unwind_var<int> save_speedinc(mon->speed_increment);
if (!mon->pickup_item(mitm[index], false, true))
{
@@ -5038,6 +5042,8 @@ void wizard_give_monster_item(monsters *mon)
if (unequipped)
mon->equip(mitm[old_eq], mon_slot, 1);
}
+ unlink_item(index);
+ // In case corpse gets skeletonized.
mitm[index].clear();
return;
}