diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-11 12:43:31 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-03-11 12:43:31 +0000 |
commit | 12213fbee2d290bf594b9219ae6720075166ca79 (patch) | |
tree | 09e6ed074b8ed67527f2aa4def9e9210512d448b /crawl-ref/source/items.cc | |
parent | 97b0e340b5f4239ec944300643be9e676f64cd9f (diff) | |
download | crawl-ref-12213fbee2d290bf594b9219ae6720075166ca79.tar.gz crawl-ref-12213fbee2d290bf594b9219ae6720075166ca79.zip |
Suppress doubled autopickup messages.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1014 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r-- | crawl-ref/source/items.cc | 23 |
1 files changed, 16 insertions, 7 deletions
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; |