summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-stuff.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-12-22 12:14:25 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-12-22 12:14:25 +0100
commit19b368a30ab08540eddec3314ff8128c020e6fdf (patch)
tree172346570b316184df381cd8875b676bf98f5d4e /crawl-ref/source/mon-stuff.cc
parent0e15cbcd0545bda8db270dd354c93bbf6d82208e (diff)
downloadcrawl-ref-19b368a30ab08540eddec3314ff8128c020e6fdf.tar.gz
crawl-ref-19b368a30ab08540eddec3314ff8128c020e6fdf.zip
Don't destroy monster inventory prematurely -- banished/summoned mimics need it.
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r--crawl-ref/source/mon-stuff.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 76f964fe20..77f74ff11c 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -158,6 +158,7 @@ const item_def *give_mimic_item(monsters *mimic)
return 0;
if (!mimic->pickup_misc(mitm[it], 0))
ASSERT("Mimic failed to pickup its item.");
+ ASSERT(mimic->inv[MSLOT_MISCELLANY] != NON_ITEM);
return (&mitm[mimic->inv[MSLOT_MISCELLANY]]);
}
@@ -1461,7 +1462,7 @@ int monster_die(monsters *monster, killer_type killer,
const bool gives_xp = (!summoned && !mons_class_flag(monster->type,
M_NO_EXP_GAIN));
- const bool drop_items = !hard_reset;
+ bool drop_items = !hard_reset;
const bool mons_reset(killer == KILL_RESET || killer == KILL_DISMISSED);
@@ -2047,7 +2048,7 @@ int monster_die(monsters *monster, killer_type killer,
// A banished monster that doesn't go on the transit list
// loses all items.
if (!monster->is_summoned())
- monster->destroy_inventory();
+ drop_items = false;
break;
}
@@ -2055,7 +2056,7 @@ int monster_die(monsters *monster, killer_type killer,
monster->flags |= MF_BANISHED;
monster->set_transit(level_id(LEVEL_ABYSS));
in_transit = true;
- monster->destroy_inventory();
+ drop_items = false;
// Make monster stop patrolling and/or travelling.
monster->patrol_point.reset();
monster->travel_path.clear();
@@ -2066,7 +2067,7 @@ int monster_die(monsters *monster, killer_type killer,
break;
default:
- monster->destroy_inventory();
+ drop_items = false;
break;
}
@@ -2129,7 +2130,7 @@ int monster_die(monsters *monster, killer_type killer,
_elven_twin_died(monster, in_transit);
}
else if (mons_is_mimic(monster->type))
- monster->destroy_inventory();
+ drop_items = false;
else if (!monster->is_summoned())
{
if (mons_genus(monster->type) == MONS_MUMMY)