summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 2c1a077769..2f7f552d3e 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1509,6 +1509,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.
@@ -1518,6 +1525,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);