From f871bcf801ff746fce2ceb778f54535412e4d117 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Wed, 3 Jan 2007 08:06:06 +0000 Subject: [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 --- crawl-ref/source/food.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/food.cc') 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); } -- cgit v1.2.3-54-g00ecf