summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 14:23:40 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-07 14:23:40 +0000
commitccb9171b5884a80787b98b1845f5a8e8e6275165 (patch)
treed1bbb778a06886d85d6a155b4b7aef750f04e5aa /crawl-ref/source/misc.cc
parentbdc37d28a47c51a60bf740ae42b8cbd4ea4398ee (diff)
downloadcrawl-ref-ccb9171b5884a80787b98b1845f5a8e8e6275165.tar.gz
crawl-ref-ccb9171b5884a80787b98b1845f5a8e8e6275165.zip
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
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc33
1 files changed, 17 insertions, 16 deletions
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;