summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-23 03:04:23 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-23 03:04:23 -0800
commit73d6545ba6d67290e93ec9097c07da6bf7b84d79 (patch)
treef4fa40ea67d0dfbae1f656439bf24f11e220b1d4 /crawl-ref/source/spells3.cc
parentc58f6e940aa83c0e1c9e6bcc6614adcc0e2a4d79 (diff)
downloadcrawl-ref-73d6545ba6d67290e93ec9097c07da6bf7b84d79.tar.gz
crawl-ref-73d6545ba6d67290e93ec9097c07da6bf7b84d79.zip
receive_corpses(): don't crash if no items avail
If there aren't any floor item slots available, don't crash.
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index aa9a370c32..a8ac9055d2 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -703,6 +703,9 @@ bool receive_corpses(int pow, coord_def where)
dummy.type = mon_type;
int index_of_corpse_created = get_item_slot();
+ if (index_of_corpse_created == NON_ITEM)
+ break;
+
if (mons_genus(mon_type) == MONS_HYDRA)
dummy.number = random2(20) + 1;