diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-19 01:16:12 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-19 01:16:12 +0000 |
commit | 1be1dbe3e9762362ea0d7537244bc9e7ac69835b (patch) | |
tree | d82222ab22cbaa1348be2666160ba44daef43776 /crawl-ref/source/tile1.cc | |
parent | 41cd39970b517da08f5caf2cffb6d056177a6744 (diff) | |
download | crawl-ref-1be1dbe3e9762362ea0d7537244bc9e7ac69835b.tar.gz crawl-ref-1be1dbe3e9762362ea0d7537244bc9e7ac69835b.zip |
[1941576] Fixed issue with too many blank squares in the inventory. Now, there will be at least one row of floor items displayed.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4351 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tile1.cc')
-rw-r--r-- | crawl-ref/source/tile1.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc index cb08b5ae26..6828ca631f 100644 --- a/crawl-ref/source/tile1.cc +++ b/crawl-ref/source/tile1.cc @@ -4310,6 +4310,11 @@ void tile_draw_inv(int flag) if (numInvTiles > MAXINV) numInvTiles = MAXINV; + // Show one row of ground tiles, no matter what. This may cause some + // items not to show up, but theoretically you've ordered tile_show_items + // to prioritize the important stuff. + int max_inventory_items = std::min(numInvTiles - r->mx, ENDOFPACK); + // which items to show in inventory const char *item_chars = Options.tile_show_items; @@ -4322,7 +4327,7 @@ void tile_draw_inv(int flag) // first set eq_flag = 1 for all slots that actually hold valid items // XXX: Why? --jpeg - for (int i = 0; i < ENDOFPACK; i++) + for (int i = 0; i < max_inventory_items; i++) { eq_flag[i] = (you.inv[i].quantity != 0 && is_valid_item( you.inv[i])) ? 1 : 0; @@ -4388,7 +4393,7 @@ void tile_draw_inv(int flag) if (type == -1) continue; - for (int j = 0; j < ENDOFPACK && n < numInvTiles; j++) + for (int j = 0; j < max_inventory_items && n < numInvTiles; j++) { if (you.inv[j].base_type == type && eq_flag[j] != 0) { |