From 12213fbee2d290bf594b9219ae6720075166ca79 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 11 Mar 2007 12:43:31 +0000 Subject: Suppress doubled autopickup messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1014 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/items.cc | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/items.cc') diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index 1f3f69e71d..98a2c732e2 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -738,6 +738,11 @@ bool need_to_autopickup() return will_autopickup; } +void request_autopickup(bool do_pickup) +{ + will_autopickup = do_pickup; +} + /* * Takes keyin as an argument because it will only display a long list of items * if ; is pressed. @@ -759,11 +764,9 @@ void item_check(char keyin) } autoinscribe_items(); - will_autopickup = true; origin_set(you.x_pos, you.y_pos); - for ( int objl = igrd[you.x_pos][you.y_pos]; objl != NON_ITEM; objl = mitm[objl].link ) { @@ -809,7 +812,6 @@ void item_check(char keyin) counter++; counter_max = 0; // to skip next part. - } if ((counter_max > 0 && counter_max < 6) @@ -825,7 +827,8 @@ void item_check(char keyin) } } - if (counter_max > 5 && keyin != ';') { + if (counter_max > 5 && keyin != ';') + { mpr("There are several objects here."); learned_something_new(TUT_MULTI_PICKUP); } @@ -2995,8 +2998,8 @@ bool can_autopickup() return (true); } - -void autopickup() + +static void do_autopickup() { //David Loewenstern 6/99 int result, o, next; @@ -3004,7 +3007,7 @@ void autopickup() bool tried_pickup = false; will_autopickup = false; - + if (!can_autopickup()) return; @@ -3078,6 +3081,12 @@ void autopickup() stop_delay(); } +void autopickup() +{ + do_autopickup(); + item_check(false); +} + int inv_count(void) { int count=0; -- cgit v1.2.3-54-g00ecf