From a9561bf49af71b98db45679d7489d483af7c2266 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 10 Dec 2008 07:19:45 +0000 Subject: Make debug_item_scan() complain about summoned items found on the floor. Warn if transfering summoned items to/from a monster, or if giving an item to a monster with MF_HARD_RESET. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7803 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/debug.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crawl-ref') diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index 563b08c752..51bb7ceb5c 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -2091,6 +2091,12 @@ void debug_item_scan( void ) mpr( "Bad plus or special value:", MSGCH_ERROR ); _dump_item( name, i, mitm[i] ); } + else if (mitm[i].flags & ISFLAG_SUMMONED + && in_bounds(mitm[i].pos)) + { + mpr( "Summoned item on floor:", MSGCH_ERROR ); + _dump_item( name, i, mitm[i] ); + } } // Quickly scan monsters for "program bug"s. @@ -4280,10 +4286,21 @@ void wizard_give_monster_item(monsters *mon) // Item is gone from player's inventory dec_inv_item_quantity(player_slot, item.quantity); + if ((mon->flags & MF_HARD_RESET) && !(new_item.flags & ISFLAG_SUMMONED)) + mprf(MSGCH_WARN, "WARNING: Monster has MF_HARD_RESET and all its " + "items will disappear when it does."); + else if ((new_item.flags & ISFLAG_SUMMONED) && !mon->is_summoned()) + mprf(MSGCH_WARN, "WARNING: Item is summoned and will disappear when " + "the monster does."); + // Monster's old item moves to player's inventory. if (old_eq != NON_ITEM) { mpr("Fetching monster's old item."); + if (mitm[old_eq].flags & ISFLAG_SUMMONED) + mprf(MSGCH_WARN, "WARNING: Item is summoned and shouldn't really " + "be anywhere but in the inventory of a summoned monster."); + move_item_to_player(old_eq, mitm[old_eq].quantity); } } -- cgit v1.2.3-54-g00ecf