diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-12 02:00:42 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-09-12 02:00:42 +0000 |
commit | 1046b69374e5bc6273fa2ce4160a5533cdb9a6ab (patch) | |
tree | 61c2868c75be39bc85352a6081e4f7e57e1f3776 /crawl-ref/source/items.cc | |
parent | b424c96c3e4f914f37bc9d693f5ae59ad60d4bad (diff) | |
download | crawl-ref-1046b69374e5bc6273fa2ce4160a5533cdb9a6ab.tar.gz crawl-ref-1046b69374e5bc6273fa2ce4160a5533cdb9a6ab.zip |
Fix 2059618: god gifts were not autoinscribed.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6908 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 917f5b1c6a..f0e463d79a 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2090,9 +2090,12 @@ void drop() static void _autoinscribe_item( item_def& item ) { - /* if there's an inscription already, do nothing */ - if ( item.inscription.size() > 0 ) + // If there's an inscription already, do nothing - except + // for automatically generated inscriptions + if ( !item.inscription.empty() && item.inscription != "god gift") return; + const std::string old_inscription = item.inscription; + item.inscription.clear(); std::string iname = _autopickup_item_name(item); @@ -2107,15 +2110,20 @@ static void _autoinscribe_item( item_def& item ) // don't want to autopickup it again. std::string str = Options.autoinscriptions[i].second; if ((item.flags & ISFLAG_DROPPED) && !in_inventory(item)) - { str = replace_all(str, "=g", ""); - } // Note that this might cause the item inscription to // pass 80 characters. item.inscription += str; } } + if ( !old_inscription.empty() ) + { + if ( item.inscription.empty() ) + item.inscription = old_inscription; + else + item.inscription = old_inscription + ", " + item.inscription; + } } static void _autoinscribe_floor_items() |