diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-12-15 00:01:58 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-12-15 00:06:49 +0100 |
commit | f5ad2d06f0bac4de0a61d97b8887b70616006969 (patch) | |
tree | 58296a0761e58ecc58107a6ea530fbbd7ccccd84 /crawl-ref/source/directn.cc | |
parent | 08b32044b9fe15e1026a463da9d3d4cad19b3942 (diff) | |
download | crawl-ref-f5ad2d06f0bac4de0a61d97b8887b70616006969.tar.gz crawl-ref-f5ad2d06f0bac4de0a61d97b8887b70616006969.zip |
Make mimics hold the item they're mimicking, instead of fragile hacks with saving RNG state.
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 34cef9c9f9..66d3b94f96 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -521,11 +521,7 @@ void full_describe_view() const bool unknown_mimic = (mon && mons_is_unknown_mimic(mon)); if (unknown_mimic) // It'll be on top. - { - item_def item; - get_mimic_item(mon, item); - list_items.push_back(item); - } + list_items.push_back(get_mimic_item(mon)); const int oid = igrd(*ri); if (oid == NON_ITEM) @@ -1754,11 +1750,7 @@ std::string get_terse_square_desc(const coord_def &gc) const monsters& mons = *monster_at(gc); if (mons_is_mimic(mons.type) && !(mons.flags & MF_KNOWN_MIMIC)) - { - item_def item; - get_mimic_item(&mons, item); - desc = item.name(DESC_PLAIN); - } + desc = get_mimic_item(&mons).name(DESC_PLAIN); else desc = mons.full_name(DESC_PLAIN, true); } @@ -3361,9 +3353,7 @@ static void _describe_cell(const coord_def& where, bool in_range) _describe_monster(mon); else { - item_def item; - get_mimic_item( mon, item ); - std::string name = get_menu_colour_prefix_tags(item, + std::string name = get_menu_colour_prefix_tags(get_mimic_item(mon), DESC_NOCAP_A); mprf(MSGCH_FLOOR_ITEMS, "You see %s here.", name.c_str()); } |