From ccb9171b5884a80787b98b1845f5a8e8e6275165 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 7 Jul 2008 14:23:40 +0000 Subject: Fix potions of decay created by mummy curse sometimes being inscribed. Change inscription prompt to work as intended by David, after all. :) Make manuals use a reading counter (plus2) that is initialized with 3 + random2(15). Once it reaches 0, the manual crumbles to dust. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6443 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/misc.cc | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'crawl-ref/source/misc.cc') diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index aa560a50d4..715a70edd3 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -969,8 +969,8 @@ void split_potions_into_decay( int obj, int amount, bool need_msg ) if (need_msg && get_ident_type(OBJ_POTIONS, POT_DECAY) == ID_KNOWN_TYPE) _potion_stack_changed_message(potion, amount, false); - // just in case - you.wield_change = true; + if (you.equip[EQ_WEAPON] == obj) + you.wield_change = true; you.redraw_quiver = true; if (is_blood_potion(potion)) @@ -996,7 +996,7 @@ void split_potions_into_decay( int obj, int amount, bool need_msg ) else you.inv[obj].quantity -= amount; - you.inv[m].quantity += amount; + you.inv[m].quantity += amount; return; } @@ -1015,20 +1015,21 @@ void split_potions_into_decay( int obj, int amount, bool need_msg ) if (freeslot >= 0 && freeslot < ENDOFPACK && !is_valid_item(you.inv[freeslot])) { - item_def &item = you.inv[freeslot]; - item.link = freeslot; - item.slot = index_to_letter(item.link); - item.base_type = OBJ_POTIONS; - item.sub_type = POT_DECAY; - item.quantity = amount; - item.x = -1; - item.y = -1; + item_def &item = you.inv[freeslot]; + item.link = freeslot; + item.slot = index_to_letter(item.link); + item.base_type = OBJ_POTIONS; + item.sub_type = POT_DECAY; + item.quantity = amount; + item.x = -1; + item.y = -1; // Keep description as it was. - item.plus = potion.plus; - item.plus2 = 0; - item.special = 0; - item.flags = 0; - item.colour = potion.colour; + item.plus = potion.plus; + item.plus2 = 0; + item.special = 0; + item.flags = 0; + item.colour = potion.colour; + item.inscription = ""; you.inv[obj].quantity -= amount; return; -- cgit v1.2.3-54-g00ecf