diff options
-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() |