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/acr.cc | 12 +++++++----- crawl-ref/source/items.cc | 23 ++++++++++++++++------- crawl-ref/source/items.h | 2 +- 3 files changed, 24 insertions(+), 13 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 2272362f19..b7ded5c700 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -836,7 +836,6 @@ static void input() fire_monster_alerts(); - if (Options.tut_just_triggered) Options.tut_just_triggered = false; @@ -851,7 +850,8 @@ static void input() if (Options.tutorial_left && i_feel_safe()) { - if ( 2*you.hp < you.hp_max || 2*you.magic_points < you.max_magic_points ) + if ( 2*you.hp < you.hp_max + || 2*you.magic_points < you.max_magic_points ) { tutorial_healing_reminder(); } @@ -877,7 +877,7 @@ static void input() middle_input(); - if ( need_to_autopickup() ) + if (need_to_autopickup()) autopickup(); handle_delay(); @@ -1154,7 +1154,8 @@ void process_command( command_type cmd ) break; case CMD_INSPECT_FLOOR: - item_check(';'); + // item_check(';'); + request_autopickup(); break; case CMD_WIELD_WEAPON: @@ -2979,7 +2980,8 @@ static void move_player(int move_x, int move_y) move_y = 0; you.turn_is_over = true; - item_check( false ); + // item_check( false ); + request_autopickup(); } // BCR - Easy doors single move 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; diff --git a/crawl-ref/source/items.h b/crawl-ref/source/items.h index af0ab9d4f7..5c123ecc87 100644 --- a/crawl-ref/source/items.h +++ b/crawl-ref/source/items.h @@ -70,7 +70,7 @@ void destroy_item_stack( int x, int y ); * called from: acr * *********************************************************************** */ void item_check(char keyin); - +void request_autopickup(bool do_pickup = true); // last updated: 08jun2000 {dlb} /* *********************************************************************** -- cgit v1.2.3-54-g00ecf