diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-07 08:41:09 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-12-07 08:41:09 +0000 |
commit | e389d95705a390483c21191eec96a12824c6cb69 (patch) | |
tree | 5178d7db19c7f5391dee298194c59085947d494a /crawl-ref/source/items.cc | |
parent | 0f4b659dddc446658c1cb6387dfdd03bcb758db5 (diff) | |
download | crawl-ref-e389d95705a390483c21191eec96a12824c6cb69.tar.gz crawl-ref-e389d95705a390483c21191eec96a12824c6cb69.zip |
Fix bug 2398346: don't record note on identify-by-wearing of mundane armour.
Fix some god gift autoinscription problems.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7762 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index f92a14d34f..0e79a1af7b 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1587,6 +1587,13 @@ int move_item_to_player( int obj, int quant_got, bool quiet ) _check_note_item(mitm[obj]); + const bool floor_god_gift + = mitm[obj].inscription.find("god gift") + != std::string::npos; + const bool inv_god_gift + = you.inv[m].inscription.find("god gift") + != std::string::npos; + // If the object on the ground is inscribed, but not // the one in inventory, then the inventory object // picks up the other's inscription. @@ -1596,6 +1603,18 @@ int move_item_to_player( int obj, int quant_got, bool quiet ) you.inv[m].inscription = mitm[obj].inscription; } + // Remove god gift inscription unless both items have it. + if (floor_god_gift && !inv_god_gift + || inv_god_gift && !floor_god_gift) + { + you.inv[m].inscription + = replace_all(you.inv[m].inscription, + "god gift, ", ""); + you.inv[m].inscription + = replace_all(you.inv[m].inscription, + "god gift", ""); + } + if (is_blood_potion(mitm[obj])) pick_up_blood_potions_stack(mitm[obj], quant_got); |