summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-23 16:54:33 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-23 16:54:33 +0000
commitc7a0a4b52c936a096a329cb49f8bdb9d5a4ca09a (patch)
treef081c0a2d9c1d58838a86e99dd8bb852f63a163e /crawl-ref/source/misc.cc
parentcf81724d60bf6b882e7319a719acfabc9d0c6fe0 (diff)
downloadcrawl-ref-c7a0a4b52c936a096a329cb49f8bdb9d5a4ca09a.tar.gz
crawl-ref-c7a0a4b52c936a096a329cb49f8bdb9d5a4ca09a.zip
Fix [2530350]: flags set incorrectly on coagulated potions which spill out
of inventory. It looks like some attributes (.link, .slot) still don't get set; jpeg, can you review? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8711 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 7b564548de..876a3d56eb 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -625,10 +625,11 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
// Else, create new stack in inventory.
int freeslot = find_free_slot(blood);
- if (freeslot >= 0 && freeslot < ENDOFPACK
- && !is_valid_item(you.inv[freeslot]))
+ if (freeslot >= 0 && freeslot < ENDOFPACK)
{
item_def &item = you.inv[freeslot];
+ item.clear();
+
item.link = freeslot;
item.slot = index_to_letter(item.link);
item.base_type = OBJ_POTIONS;
@@ -637,8 +638,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
item.plus = 0;
item.plus2 = 0;
item.special = 0;
- item.flags = 0;
- item.inscription = "";
+ item.flags = (ISFLAG_KNOW_TYPE & ISFLAG_BEEN_IN_INV);
item.pos.set(-1, -1);
item_colour(item);
@@ -720,7 +720,7 @@ bool maybe_coagulate_blood_potions_inv(item_def &blood)
mitm[o].plus = 0;
mitm[o].plus2 = 0;
mitm[o].special = 0;
- mitm[o].flags = ~(ISFLAG_THROWN | ISFLAG_DROPPED);
+ mitm[o].flags = (ISFLAG_KNOW_TYPE & ISFLAG_BEEN_IN_INV);
item_colour(mitm[o]);
CrawlHashTable &props_new = mitm[o].props;