diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-27 12:17:09 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-27 12:17:09 +0000 |
commit | 1123d50843d463c533de1ab100dfc23d69cad924 (patch) | |
tree | 7f7ff3caa2e74fcc1bf7679ea8cd108280d9d55d /crawl-ref/source/monstuff.cc | |
parent | bd28b58f3c777e91dfd7ef36360717c5ca40d9cc (diff) | |
download | crawl-ref-1123d50843d463c533de1ab100dfc23d69cad924.tar.gz crawl-ref-1123d50843d463c533de1ab100dfc23d69cad924.zip |
Fix crash when the game attempted to place a corpse for a giant spore shaped
shifter which exploded.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8818 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 29d3ccb3bb..4ab71d5a1b 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -385,6 +385,13 @@ int fill_out_corpse(const monsters* monster, item_def& corpse, int place_monster_corpse(const monsters *monster, bool silent, bool force) { + // The game can attempt to place a corpse for an out-of-bounds monster + // if a shifter turns into a giant spore and explodes. In this + // case we place no corpse since the explosion means anything left + // over would be scattered, tiny chunks of shifter. + if (!in_bounds(monster->pos())) + return (-1); + item_def corpse; const int corpse_class = fill_out_corpse(monster, corpse); |