summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-05-29 01:46:19 -0400
committerNeil Moore <neil@s-z.org>2014-05-29 02:22:32 -0400
commite0ecc805fa8f602458695bb34691e5b5c3d1aa5f (patch)
tree2b69c9a294b92dd37cc21560a8afc66828b3e0fd /crawl-ref/source/items.cc
parent7a68a02bfdbac724bad17f7f29cac61ed0825d43 (diff)
downloadcrawl-ref-e0ecc805fa8f602458695bb34691e5b5c3d1aa5f.tar.gz
crawl-ref-e0ecc805fa8f602458695bb34691e5b5c3d1aa5f.zip
Allow pickup with only stationary items on the ground.
If pickup_menu is true, display the menu (with nothing selectable). If it is false, just list the items on the square.
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index f90b5ca678..fb4280f955 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1253,8 +1253,6 @@ void pickup(bool partial_quantity)
if (o == NON_ITEM)
mpr("There are no items here.");
- else if (num_items == 0)
- mpr("There are no items here that you can pick up.");
else if (you.form == TRAN_ICE_BEAST && grd(you.pos()) == DNGN_DEEP_WATER)
mpr("You can't reach the bottom while floating on water.");
// just one movable item?
@@ -1278,6 +1276,7 @@ void pickup(bool partial_quantity)
int next;
mpr("There are several objects here.");
string pickup_warning;
+ bool any_selectable = false;
while (o != NON_ITEM)
{
// Must save this because pickup can destroy the item.
@@ -1288,6 +1287,7 @@ void pickup(bool partial_quantity)
o = next;
continue;
}
+ any_selectable = true;
if (keyin != 'a')
{
@@ -1334,6 +1334,14 @@ void pickup(bool partial_quantity)
canned_msg(MSG_OK);
}
+ // If there were no selectable items (all corpses, for example),
+ // list them.
+ if (!any_selectable)
+ {
+ for (stack_iterator si(you.pos(), true); si; si++)
+ mprf_nocap("%s", get_menu_colour_prefix_tags(*si, DESC_A).c_str());
+ }
+
if (!pickup_warning.empty())
mpr(pickup_warning.c_str());
}