summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-03 08:06:06 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-03 08:06:06 +0000
commitf871bcf801ff746fce2ceb778f54535412e4d117 (patch)
tree72d9d94acab64b2e1f886cd6eaf726de31a16baa /crawl-ref/source/food.cc
parent392d820b114d9b703ec1bf2f94710e7a785a9ced (diff)
downloadcrawl-ref-f871bcf801ff746fce2ceb778f54535412e4d117.tar.gz
crawl-ref-f871bcf801ff746fce2ceb778f54535412e4d117.zip
[1626675] Handle auto_list better when eating chunks off the ground. This is
still not perfect, since it's possible to get *two* -more- prompts, but it'll do for now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@780 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 93af87ce84..c0bb37db97 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -590,15 +590,21 @@ bool eat_from_floor(void)
if (player_is_levitating() && !wearing_amulet(AMU_CONTROLLED_FLIGHT))
return (false);
+ bool need_more = false;
for (int o = igrd[you.x_pos][you.y_pos]; o != NON_ITEM; o = mitm[o].link)
{
if (mitm[o].base_type != OBJ_FOOD)
continue;
it_name( o, DESC_NOCAP_A, str_pass );
- snprintf( info, INFO_SIZE, "Eat %s%s?", (mitm[o].quantity > 1) ? "one of " : "",
- str_pass );
- mpr( info, MSGCH_PROMPT );
+ mprf( MSGCH_PROMPT,
+ "Eat %s%s?", (mitm[o].quantity > 1) ? "one of " : "",
+ str_pass );
+
+ // If we're prompting now, we don't need a -more- when
+ // breaking out, because the prompt serves as a -more-. Of
+ // course, the prompt can re-set need_more to true.
+ need_more = false;
unsigned char keyin = tolower( getch() );
@@ -614,13 +620,19 @@ bool eat_from_floor(void)
if (keyin == 'y')
{
if (!can_ingest( mitm[o].base_type, mitm[o].sub_type, false ))
- return (false);
+ {
+ need_more = true;
+ continue;
+ }
eat_floor_item(o);
return (true);
}
}
+ if (need_more && Options.auto_list)
+ more();
+
return (false);
}