summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-10 07:19:45 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-10 07:19:45 +0000
commita9561bf49af71b98db45679d7489d483af7c2266 (patch)
treee43f3e0e3dc4f181a5a5ad3f044026ad944f4c44 /crawl-ref/source
parente9a49b7279640142240a8c4df29b5684f797f4cb (diff)
downloadcrawl-ref-a9561bf49af71b98db45679d7489d483af7c2266.tar.gz
crawl-ref-a9561bf49af71b98db45679d7489d483af7c2266.zip
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
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/debug.cc17
1 files changed, 17 insertions, 0 deletions
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);
}
}