From 1046b69374e5bc6273fa2ce4160a5533cdb9a6ab Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 12 Sep 2008 02:00:42 +0000 Subject: 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 --- crawl-ref/source/items.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/items.cc') 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() -- cgit v1.2.3-54-g00ecf