summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 03:49:43 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-19 03:49:43 +0000
commit59a3c76e56576037b1c30c99c14cebdd03804ef6 (patch)
tree692bf7d6a16df31e1db9ed351df38ee1335ee95b
parent4333f1287c4c7d911162dbbd91566f96703d2ffd (diff)
downloadcrawl-ref-59a3c76e56576037b1c30c99c14cebdd03804ef6.tar.gz
crawl-ref-59a3c76e56576037b1c30c99c14cebdd03804ef6.zip
[2517979] Fixing double inventory items for items on the ground.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8570 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/tilesdl.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index ef3a00c905..3cce15564a 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -1279,8 +1279,8 @@ void TilesFramework::update_inventory()
int max_pack_row = (ENDOFPACK-1) / mx + 1;
int max_pack_items = max_pack_row * mx;
- bool shown[ENDOFPACK];
- memset(shown, 0, sizeof(shown));
+ bool inv_shown[ENDOFPACK];
+ memset(inv_shown, 0, sizeof(inv_shown));
int num_ground = 0;
for (int i = igrd(you.pos()); i != NON_ITEM; i = mitm[i].link)
@@ -1315,7 +1315,7 @@ void TilesFramework::update_inventory()
if ((int)inv.size() >= max_pack_items)
break;
- if (shown[i]
+ if (inv_shown[i]
|| !is_valid_item(you.inv[i])
|| you.inv[i].quantity == 0
|| (!show_any && you.inv[i].base_type != type))
@@ -1338,7 +1338,7 @@ void TilesFramework::update_inventory()
}
}
- shown[i] = true;
+ inv_shown[i] = true;
inv.push_back(desc);
}
}
@@ -1391,6 +1391,8 @@ void TilesFramework::update_inventory()
}
// Then, as many ground items as we can fit.
+ bool ground_shown[MAX_ITEMS];
+ memset(ground_shown, 0, sizeof(ground_shown));
for (unsigned int c = 0; c <= show_types_len; c++)
{
if ((int)inv.size() >= mx * my)
@@ -1412,12 +1414,13 @@ void TilesFramework::update_inventory()
if ((int)inv.size() >= mx * my)
break;
- if (!show_any && mitm[i].base_type != type)
+ if (ground_shown[i] || !show_any && mitm[i].base_type != type)
continue;
InventoryTile desc;
_fill_item_info(desc, mitm[i]);
desc.idx = i;
+ ground_shown[i] = true;
inv.push_back(desc);
}