From c7a0a4b52c936a096a329cb49f8bdb9d5a4ca09a Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 23 Jan 2009 16:54:33 +0000 Subject: 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 --- crawl-ref/source/misc.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/misc.cc') 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; -- cgit v1.2.3-54-g00ecf